Question

I want to set the style attribute to the div tag in dojo 1.8.I have used the following code.

    require([
        "dojo/request",
        "dojo/store/Memory",
        "dgrid/OnDemandGrid",
        "dojo/store/JsonRest",
        "dojo/dom",
        "dojo/dom-attr"
    ], function (request, Memory, OnDemandGrid,JsonRest,dom,domAttr) {
            jsonstore = new JsonRest({target: url,idProperty: "srno"});
            grid = new OnDemandGrid({
                store: jsonstore,
                columns: Layout,
                minRowsPerPage : 40,
                maxRowsPerPage : 40,
                keepScrollPosition : true,
                loadingMessage: "Loading data...",
                noDataMessage: "No results found."
            }, "grid");
            domAttr.set(dom.byId("grid"),"style","height:250px");
            grid.startup();
        });

It works fine with firefox.In IE,the below code is not working

        domAttr.set(dom.byId("grid"),"style","height:250px");

I put alert and verified.

         alert(domAttr.get(dom.byId("grid"),"style")

In firefox ,it is showing height:250px . In IE it is null. Can someone tell me how to make domAttr.set work in IE as well?

Was it helpful?

Solution

Try dojo/dom-style instead of dom-Attr

require(["dojo/dom-style"], function(domStyle){
 domStyle.set("someNode", "width", "100px");
});

Here's the link to the ref : http://dojotoolkit.org/reference-guide/1.8/dojo/dom-style.html#dojo-dom-style

Regards, Miriam

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top