Selecting editor:"checkbox" doesn't work as expected
When creating a new declare([OnDemandGrid, Keyboard, Selection, Editor, DijitRegistry]) with column {editor: "checkbox"} the whole cell will trigger the checkbox. This way it sometimes gets selected unintentionally. Also, clicking outside the checkbox in the cell doesn't always select the checkbox, which makes it even more confusing.
To solve this problem I usually put the check box in a column all by is self and use a second column for any other information I want to have next to it.
That is not a solution. Also, the checkbox is by itself in a column.
try selection: "none"
Where?
I've added selectionMode:"none" to the grid instantiate params, but I can still check the box by clicking anywhere in the cell.
I had the key wrong, sorry, but you figured out my was my suggestion. I don't get the behavior you do.
Here is a snippet of my dgrid that only checks the check box if you click in the box, not the row:
return declare([Grid, Tree, Selection, Selector, DijitRegistry],
{
selectionMode: "none",
collection: new Memory({data: []}),
allowSelect: function(row){
return row.data.type !== "dir" && row.data.extention === 'xml' ;
},
constructor: function(args)
{
dojo.safeMixin(this, args);
var grid = this;
this.columns = {
check:
{
label: ' ',
sortable: false,
selector: 'checkbox'
},
name:
{
label: 'Filename',
renderExpando: true,
sortable: false,
@EToreo, this issue is about Editor with editor: 'checkbox', not Selector, if that's what you're thinking of.
I believe the reason most of the cell qualifies as the checkbox's hitbox is actually due to a style in dgrid.css which assigns 99% width to .dgrid-input. The main intent of this is to make editors like textboxes span the entire cell by default. You might want to experiment with overriding that style for the dgrid-input class inside your checkbox column. (Set width to auto)
In dgrid 0.4 and higher, it may be feasible for us to override this selector for checkbox/radio inputs specifically within dgrid.css itself, since 0.4+ only supports IE8+ and attribute selectors should be supported in IE7+.
@kfranqueiro We are also facing the same issue and lot of our customers are complaining about this please let me if this is planned in any release.
@wshager did you find a solution for this? @kfranqueiro did this got fixed?
@ahmad-atallah If I recall correctly I just made a custom override of sorts. It's been too long and I'm not using Dgrid anymore.