jQuery UI Element vs Dojo (Dijit) Form Element

Posted by Muers on Stack Overflow See other posts from Stack Overflow or by Muers
Published on 2011-01-11T00:23:49Z Indexed on 2011/01/11 0:53 UTC
Read the original article Hit count: 197

Filed under:
|
|
|

Dojo seems to have a useful feature in that it can setup event handlers and default options, etc for Dijit.form elements as it is inserting it into the DOM.

For example, Dojo: var slider = new dijit.form.HorizontalSlider({ name: sliderContainerId+'_slider', value: sliderValue, minimum: sliderMax, maximum: sliderMin,
onChange: function(value){ // some event handling logic } }, sliderContainerId);

However, the jQuery UI Slider traditionally is applied to DOM elements that already exist:

$( sliderContainerId ).slider({ value:100, min: 0, max: 500, step: 50, slide: function( event, ui ) { $( "#amount" ).val( "$" + ui.value ); } });

I need to be able to 'programmatically' create new Sliders (and other form elements), but I'm not sure how that could be achieved with the way jQuery is structured? Maybe I'm missing something obvious here....

MTIA

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about jquery-ui