TextboxList 0.3 and jQuery version out!

Moo TextboxList 0.3 changes:

  • HTML for bits not showing properly fixed
  • highlightSelector not working (due to a typo) fixed
  • GrowingInput missing pad function added (only affected if you customized growing.mini option)
  • Improved clicking the whole widget behavior
  • Other tiny enhancements / cleanup

Secondly, in the best interest of the JavaScript community, I’ve ported TextboxList to jQuery. The API changes slightly due to the different OOP approach, but all the functionality is intact. Head to jQuery TextboxList project page for more.

Update: 0.2 is out for jQuery. Bugs in autocompleter and IE have been addressed.

Displaying only a subset of the comments. Click here to display all comments.

  1. This is a lovely script. Unfortunately, I use prototype. Normally, I can get jquery to work on the same page as prototype thanks to jquery’s brilliant noconflict function. With this script, though, I can’t. Firebug spits out an error stating “this.toPaddedString is not a function” when it loads up Prototype! I have a feeling there is something in your code that is causing this to happen. I’m not saying it’s your fault – but I am saying that if you could fix it, you’d get another paying customer!

    • Guillermo Rauch about 1 year ago

      I’ll look into it!

    • Bartolome about 1 year ago

      Awesome. You’re a rockstar.

    • Bartolome about 1 year ago

      The problem lies in the GrowingInput.js script. Commenting out

      calc.css(p, element.css(p));

      fixes the problem, though at what cost? Not sure, the script looks the same to me..

    • Guillermo Rauch about 1 year ago

      Ok that was my mistake. $.each passes the index first, not the value. I fixed it and released 0.3. Not sure how it affected Prototype, but hopefully it’s fixed now.

    • Bartolome about 1 year ago

      OK, I’m starting to see how the backend works. I initially thought autosuggest.php was called only after the user started typing. Instead, it looks like it’s called as soon as you click. The upside to this is that it starts loading sooner than it would if you waited for a keystroke. The downside is that you can’t run any screening on the backend. For example, if I have a database with 6,000 records, I might want to run some sort of screen based on what the user has typed in. For example, if they type in ’s’, I might want to only empty out records starting with ’s’ to cut traffic by a factor of 26. With the current setup, I can’t do that. If you can’t change the backend’s response based on the input, it might as well be embedded in the page instead of returned via Ajax, right? I.e., it’s not dynamic.

      I just need to look to see how to get this to submit a GET request to autosuggest.php when the user types, instead of on load or when they first click. Anyone have suggestions for how to do that?

    • Guillermo Rauch about 1 year ago

      This is something I might eventually add. But usually, the idea of the tokenizer is that you work with pre-fetched data. It’s the case of Gmail or Facebook contacts list, which is fetched once via AJAX and made persistent.

      Also, the class is designed in such a way that it’s easy to extend and add this functionality, because I had it in mind at the time of writing the API.

    • Olivier REfalo about 1 year ago

      Bartolome I am with you with on this one.

      Guillermo in a different post was saying that the backend was flexible
      enough to allow these kinds of queries. In fact I even asked him his 2c
      advise to implement it and now only realize why I didn’t get any answer…
      If only I had known before purchasing… I guess this is not plug and play,
      I’ll have to get my hands dirty…