Getting combo options via javascript function

I have one combo with over 20,000+ options which I am currently using through filteration with url + cache=true. This combo is used many times in my application and it would be better for me to load the options at the beginning via an Ajax call and then feed the combo requirements via a Javascript Function. Is there any way of doing that? i.e. instead of url can I call a javascript function which would still return results in required xml format but from the previously downloaded Ajax data?

Thanks
Purvez

Yes, you may load xml by ajax and set combo options by loadXMLString method. Order you may load JS object and call addOption method:

[{value:“value 1”,text:“text 1”},{value:“value 2”,text:“text 2”}, …,{value:“value N”,text:“text N”}]

this can be loaded by ajax. Then string should be converted to the object:

eval(“a=”+str);
combo.addOption(a);

Thanks for your suggestion Alexandra. The reason I can’t use loadXMLString or addOption methods is because of the number of options (over 20K) which makes it TOO slow if the full list is loaded. I have to use Filteration with URL and cache and therefore the enableFilteringMode with url is required. However I want to use a javascript function instead of a URL. That way it will be much quicker and also I won’t have to go to the server each time.

I hope you understand.

Purvez

Yes, I understood the issue. Unfortunately, there is not a “function” support for filtering

Thanks for understanding. Is there any way we can get this put on an enhancement list?

Purvez

Hello,

we are not planing this feature for the next release. We’ll discuss this functionality and possibly add it in one of the future release.