javascript - Setting Width For Dojo Button -


note: related this question.

i trying create dojo button programmatically this:

var btnok = new dijit.form.button({     label: "ok",     showlabel: true,     style: "height: 20px; width: 50px;" }); 

now though specify width, while displaying button width set minimum (i.e text + margin). reason explained in answer dojo overrides css style button (class="dijitbuttonnode"). further (in same answer) width set overriding styles same class.

is possible same (i.e set width) without css workaround ?

finally, worked out. set width have set width using dojo.style function

    dojo.create("button",{id: "btnok",type: "button"},dojo.body());      var btnok = new dijit.form.button({                 label: "ok",                 showlabel: true,                 style: "height: 20px;"                 },                "btnok");      dojo.style("btnok","width","40px"); 

Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -