Monday, July 22, 2013

jQuery UI Cookbook

I'm pleased to announce the arrival my new bookjQuery UI Cookbook. It's a recipe format, several for each widget. The theme of the book is about extending widgets to make them do what you need. Something else worth mentioning here is that I've decided to give myself the role of "support team". Drop me a line here, if you have questions about the code in the book, and I'll do my best to get it sorted out.

7 comments :

  1. Hi Adam, I'm enjoying your book so far. In the accordion section, Custom data and categories, starting on page 38. When I run that code from chrome, all is well, and the autocomplete sorts by category grouping the first and third items together under completed. But from IE (yes, IE, i know...) it doesn't. So the menu is in the order: First Item, Second Item, Third Item.

    Not sure why.

    Dave

    ReplyDelete
  2. Hi Again,

    further to my previous query, on the autocomplete sorting issue...

    This does work in both IE 10 and Chrome:
    items.sort(function(a, b){
    if (a.cat > b.cat) { return 1;}
    if (a.cat < b.cat) {
    return -1;
    }
    return 0;
    });

    Dave

    ReplyDelete
    Replies
    1. Hi Dave,

      Thanks for the feedback and the correction. I've posted the updated code here:

      https://gist.github.com/adamboduch/6074338

      Delete
  3. Hi Adam,
    Found another minor glitch in your book. In Chapter 4, page 70, the code that makes the calendar fade out and in when you change months... the way it's written, it does the fade thing when you click a different day in the same month... BUT, if you do this:

    if ((inst.currentMonth !== inst.selectedMonth) ||
    (inst.currentYear !== inst.selectedYear))
    { inst.dpDiv.fadeOut(500, function(){
    inst.dpDiv.fadeIn(300);
    _super._updateDatepicker.call(self, inst);
    });
    } else {
    _super._updateDatepicker.call(self, inst);
    }

    inside the code block of the _updateDatepicker function, then it works like a charm!

    Dave.

    ps: I'm learning loads from the book.

    ReplyDelete
  4. Hi Adam,

    I need to work on that previous post a bit... if you don't click a day in the month you move to, and then come back to the original month, that last transition then just jumps without the fadein/out. It works as long as you click a day in the month you are in first.... I'll post again, when I come up with a more bulletproof tweak.

    Dave

    ReplyDelete
    Replies
    1. Hi Dave,

      Thanks for pointing out the issue. That was a good find. This code should fix it. Let me know if it's what you're looking for, or if I can further improve it.

      https://gist.github.com/adamboduch/6086040

      Delete
  5. Hi Adam,

    Yup, that's very close to what I had in mind. Excellent. Works like a champ now. I was just having a little trouble finding the bit where you detect the month change.

    Another tidbit added to my knowledge base. I thing I'm learning more helping figure out the issues when I come across them.

    Dave

    ReplyDelete