I have an Enhanced Grid populated by an ItemFileWriteStore. One of the items of data in the store is:
check: true
Then in the enhanced grid I have:
{
field: "check",
name: "Value Check",
editable: true,
type: dojox.grid.cells.Bool
}
This gives me a column full of checkboxes. I haven't been able to find how to handle checking these checkboxes. I want to start with every checkbox checked, and if you uncheck one it removes a corresponding piece of data. Is there some event handler I can attach with maybe dojo/on
? Or some method on enhanced grid that I'm not aware of? I haven't been able to find any documentation on this, I feel like I'm missing something.
I found that the best solution was to attach a handler to the "RowClick" event, since every time you click on a checkbox, the RowClick event is fired. Then loop through the data store and update everything based on the checkbox. It's definitely not efficient, but does what I need it to. It's something like this:
As far as I can tell,
event
doesn't pass an information useful for identifying which row in the grid was clicked (I'm not 100% sure, there's a lot in it). So this is the best way I came up with.