Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Member
306 Points
293 Posts
Jun 13, 2010 10:18 AM|LINK
Hehe no that do not help :
$.fn.addItems = function (data) { return this.clearSelect().each(function () { if (this.tagName == 'SELECT') { var dropdownList = this; $.each(data, function (index, optionData) { var option = new Option(optionData.Text, optionData.Value); if ($.browser.msie) { dropdownList.add(option); } else { dropdownList.add(option, null); } if ($(this).children().size() < 2) { $(this).hide(); } else { $(this).show(); } }); } }); }
Now I get : elem.ownerDocument is undefined ( var defaultView = elem.ownerDocument.defaultView;)
I have checked that the $(this).children().size() returns the proper option count.
SnowJim
Member
306 Points
293 Posts
Re: Cascading dropdown boxes and MVC2
Jun 13, 2010 10:18 AM|LINK
Hehe no that do not help :
$.fn.addItems = function (data) { return this.clearSelect().each(function () { if (this.tagName == 'SELECT') { var dropdownList = this; $.each(data, function (index, optionData) { var option = new Option(optionData.Text, optionData.Value); if ($.browser.msie) { dropdownList.add(option); } else { dropdownList.add(option, null); } if ($(this).children().size() < 2) { $(this).hide(); } else { $(this).show(); } }); } }); }Now I get : elem.ownerDocument is undefined ( var defaultView = elem.ownerDocument.defaultView;)
I have checked that the $(this).children().size() returns the proper option count.