dojo - Make DGrid selector shown or hidden based on row content -


i'm using dgrid selection grid grid uses check boxes selecting content. however, child node of tree should show checkbox parents categories , can't selected. used editor plugin this, created difficulty clearing selections (specifically, "clearselection" method of grid did nothing). switched selector plugin, selecting , deselecting rows works fine, can't seem figure out way hide check box on rows , not others.

original code

var columns = [     editor({         label: " ",         field: "itemselected",         sortable: false,         width: 33,         canedit: function(object) {             // add checkboxes child objects             return object.type === "child";         }     }, "checkbox"),     tree({         label: "item",         field: "shortitemid",         width: 150,          shouldexpand: function() {             return 1;         }     }),     {         label: "grouping name",         field: "groupingname"     } ];  var itemgrid = new selectiongrid({     store: itemstore,     style: {         width: '99%',         height: '99%'     },     columns: columns,     sort: [{attribute: "shortitemid", descending: false}] }); 

i used "editon" parameter of editor hide check box, selector plugin has "disabled" parameter, doesn't hide field @ all.

is there way can check box hidden using selector did editor?

looking @ dgrid/selector source, seems input created , added dom, regardless of whether has been disabled. presumably allow flexible enough enable , disable checkboxes on fly without need re-create dom nodes. while not possible prevent these nodes being rendered, possible hide them css, since cell node given class format field-{fieldname} (or in particular case, field-itemselected):

// javascript var columns = [     selector({         label: " ",         field: "itemselected",         sortable: false,         width: 33,         // disable checkbox not of type "child"         disabled: function (item) {             return item.type !== 'child';         }     }),     ... ];  /* css */ .field-itemselected input[disabled] {     display: none; } 

Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -