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

containing a listbox, and rerunning :





i get the standart listbox.

I also tried to create a new div inside the 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

But when I reload the content, using AJAX, of a

containing a listbox, and rerunning :
>>

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

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:
  — 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!




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 )