views:

455

answers:

1

If someone is using this jquery combobox http://jonathan.tang.name/code/jquery_combobox, I am trying to get a solution for

  1. Make it's width set dynamically based on the longest element.
  2. "lazy load" the values when the element is clicked or user tabs into it.

If this isn't possible, is there another solution i can use that has similar qualities and is just as fast?

+1  A: 

This is a start, but I would look here first though. http://remysharp.com/2007/01/20/auto-populating-select-boxes-using-jquery-ajax/

$('ui-combobox-list').each(function(i) {
  var el = $(this);
  var widest = 0;
  if (el.width() > widest) {widest = el.width();}
  $('#input-id').width(widest);
});
Hatchware