Disabling and greying out all the contents of a dojo grid -


well, application requires me disable entire grid , on button click.

i tried use

var grid = dijit.byid('mygrid'); grid .set('disabled',true); , it's not working.

i need 'grey out' contents of grid , user cannot select row. thus, changing css doesn't me.

please reply.

thanks, sonia

i don't know, have rather ghastly way myself. create partly transparent overlay on grid when it's disabled.

so i'll have css:

.gridoverlay {     position: absolute;     top: 0; bottom: 0; left: 0; right: 0;     z-index: 99;     display: none;     background: rgba(0,0,0,0.02); } .disabledgrid { color: #ddd; } .disabledgrid .gridoverlay { display: block;  } 

and button's click event this:

dojo.connect(dojo.byid("btn"), "onclick", function() {     //dojo.byid, not dijit.byid, outer dom node     var grid = dojo.byid("mygrid");     if(!dojo.query(".gridoverlay", grid).length)     {         dojo.create("div", {"class": "gridoverlay"}, grid);     }     dojo.toggleclass(grid, "disabledgrid"); }); 

like said, ghastly, use did trick. ymmv :)


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -