In our current project we have to maintain other guys codebase based on mootools. We make heavy use of this plugin https://github.com/DimitarChristoff/mooSelecta to style our select tags. Basically this plugin programatically creates a styled div representation of an ordinary select and moves the select-tag out of the viewport.
I have the need to populate an select tag based on an ajax call. This works fine for the select itself, but the styled div (created by mooselecta) is not updated - it keeps showing the old values.
Is there any chance to update this div using plain javascript?
Thanks in advance!
this is what I consider 'abandonware' - though I am the author of mooSelecta - it was my first mootools class released.
Anyway, there were issues with dynamic updates and rebuilding of the lists - I just pushed a fix and tagged it as 1.6.1
See the example/index.html
eg code.
document.getElement('button').addEvent('click', function(){
var select = document.id('p_card_type3').empty(),
c = 5;
while(c--){
select.adopt(new Element('option', {
html: 'Dynamic Option ' + c,
value: c
}));
}
// reinitialize the plugin
dynamicInstances.replaceSelect(select);
});
keep in mind you'd have to update the plugin itself.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With