Skip to content

Instantly share code, notes, and snippets.

@cogentParadigm
Created April 16, 2015 19:49
Show Gist options
  • Save cogentParadigm/a37422a57d53f8b05707 to your computer and use it in GitHub Desktop.
Save cogentParadigm/a37422a57d53f8b05707 to your computer and use it in GitHub Desktop.
dgrid selector column
define(["dojo", "dojo/on", "dojo/aspect", "sb", "put-selector/put", "dgrid/selector"],
function(dojo, on, aspect, sb, put, selector){
dojo.global.starbug.grid.columns = dojo.global.starbug.grid.columns || {};
dojo.global.starbug.grid.columns.selector = function(column){
//populate the cell with the label or value
column.renderCell = function(object, value, cell, options){
put(parent && parent.contents ? parent : cell, ".dgrid-selector");
};
column.selectorType = "checkbox";
column = selector(column);
aspect.after(column, "renderHeaderCell", function(node) {
put(node, '.dgrid-selector');
}, true);
return column;
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment