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
Post a Comment