Categories | Question details Back To List | ||
reload listbox with new options, without refresh? Hello. At first I'd like to thank for such nice posibility - to style listboxes. It works for me just fine. But now I came to the problem. I have onchange event made, to fill in the listbox with new values. If I load page - everything is styled really nice. But when I reload the content, using AJAX, of a <div> containing a listbox, and rerunning : <script>var z=new dhtmlXCombo(\"state\");</script> i get the standart listbox. I also tried to create a new div inside the <select> and reload just options, but this test finished with no luck. the content of the listbox, have not even changed. So the question would be, how to style reloaded listboxes (without refreshing the page) THanks in advance! Jaroslav Answer posted by Support on Aug 27, 2008 02:09 >>But when I reload the content, using AJAX, of a <div> containing a listbox, and rerunning : >><script>var z=new dhtmlXCombo(\"state\");</script> If you want to reload options in list, you need not created second dhtmlxcombo instance, you need to use code similar to next combo.clearAll();//clear existing options combo.loadXML(url);//load new options where combo - reference to existing dhtmlxcombo instance Answer posted by Jaroslav on Aug 27, 2008 07:41 Hello again Support. Thanks for your quick and clear answer. The problem is I have tried similar combinations, but all the time I get similar error thrown in my FireFox: this.DOMlist has no properties. What I have done is: <script>var statecombo=new dhtmlXCombo(\"state\");</script> --- this one works great. listbox get style'd. And I have on lick event: onclick="statecombo.clearAll();" When I click it, I get: this.DOMlist has no properties. I don't know why, seems to be the correct syntax. isn't it? Can't get what I'm doing wrong. Thank you guys in advance! Answer posted by Support on Aug 27, 2008 10:00 The code which you are using is correct The situation is pretty strange, such error can occur only if before using clearAll method, statecombo.destructor() was called, in any other scenario such problem must not occur. If issue still occurs - please provide any kind of sample or demo link where issue can be reconstructed ( you can send it directly to support@dhtmlx.com ) |