Dojo: dijit.form.select won't fire "onClick" event the first time clicked -


i've been through dojo docs api , tried google can't find solution problem, hope here can me out.

i'm trying create dijit.form.select programmatically (using dojo 1.4) , connect "onclick"-event of widget. here's part of code:

var dataselect = new dijit.form.select({         id    : "myselect",         name  : "myselect",         labelattr: "label",         labeltype: "html"       },       "selectid");       dataselect.addoption({value: "value", label: "first item label"});        dojo.connect(dataselect, "onclick", function() {         alert("clicked!");       }); 

what does: select-box created replacing input-field id "selectid", option "first item label" created. everythings right until here. connect "onclick"-event of select, supposed load more options via ajax (but display alert testing purposes in example).

the problem: when click on little arrow next dropdown, event fired (ok). when click on select box (the area containing option), event not fired first time click (unless clicked on arrow before). when click select box second time (and every time after that), event fire!

i've tried use "onfocus" instead of "onclick" work, dropdown not open when first clicked, if use "opendropdown"-function (which work when connecting "onclick"!).

is me, did run dojo bug or strange feature don't get? appreciated.

greetings, select0r

select (which extends _hasdropdown) has fancy code handle:

  1. mouse down on select widget
  2. mouse move 1 of options
  3. mouse up

maybe that's canceling click event.

maybe can connect _loadchildren() instead.


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -