AnsweredAssumed Answered

Checkbox in a datagrid

Question asked by allisonlbanderson on May 30, 2012
Latest reply on Jun 5, 2012 by allisonlbanderson
I have a datagrid with a field that's a link to an image service.  I want to use a formatter for the field that would be a checkbox that would turn the raster on or off.  Here's what I have so far:
    function makeRasterButton(id){            var rBtn = "<div><button dojoType='dijit.form.ToggleButton' data-dojo-props=iconClass:'dijitCheckBoxIcon' onChange=\"addRaster('"+id+"')\"></div>";              //var rBtn = "<div dojoType='dijit.form.Button';'><img src='images/page.png'";         //rBtn = rBtn + " width='18' height='18'";         //rBtn = rBtn + " onClick=\"addRaster('"+id+"')\"></div>";                return rBtn }     function addRaster(id){         var params = new esri.layers.ImageServiceParameters();           params.noData = 0;                  var rasterUrl = id;        var raster = new esri.layers.ArcGISImageServiceLayer(rasterUrl,{          imageServiceParameters: params, "opacity": .70        })                 map.addLayer(raster); }

I've gotten a simple button to work (which you can see commented out), but I would really like a check box, or toggle button.  Where does the iconClass come from?  I guess I'm not understanding how to call the 'dijitCheckBoxIcon' and have it show up correctly in the datagrid.

Yes, I still need to write the code for turning the raster off...