« Dojo 1.1 and xhrPost | Main| Using an Email Validation Widget »

FilteringSelect Pt 3.

Category   
Bookmark : del.icio.us  Technorati  Digg This  Add To Furl  Add To YahooMyWeb  Add To Reddit  Add To NewsVine 

Ok, so here's a topic I've touched on a couple of times now.  Most recently: http://dojomino.com/dojomino/blog.nsf/d6plinks/DBOS-7BEMA7.  In that post I discussed the creation of a custom widget to properly handle the html output Domino gives us to create a FilteringSelect widget.  With the upgrade to Dojo 1.1 that code no longer worked properly.  So, after a bit of digging around, I found that there'd been some changes in the source for the FilteringSelect widget that needed to be dealt with.

In my previous post, the widget we created was based on the built in FilteringSelect.  To make this work for us, we had to override the postMixInProperties.  In 1.1, things seem to work a bit differently.  I found that the options were now set through a new object called:  dijit.form._ComboBoxDataStore, that is defined in the dijit/form/ComboBox.js file.  So I had to change to override the constructor for that object adding the following:


                for (var x=0; x<root.length; x++) {
                        var tVal=root.options[x].text.replace(/\n/g,'');
                        var vVal=(root.options[x].value=="") ? tVal : root.options[x].value;

                        root.options[x].value=vVal;
                        root.options[x].text=tVal;
                }

That done, everything seems to work fine again.

Post A Comment

:-D:-o:-p:-x:-(:-):-\:angry::cool::cry::emb::grin::huh::laugh::lips::rolleyes:;-)