Hi
In a listgrid conatining many rows, when we click on a cell in a row, whole row gets selected/highlighted. Is this the default behavior?. Is it possible to select/highlight only the cell clicked.
Regards
Strive
Hi
In a listgrid conatining many rows, when we click on a cell in a row, whole row gets selected/highlighted. Is this the default behavior?. Is it possible to select/highlight only the cell clicked.
Regards
Strive
Yes, you can disable the built-in behavior via setting grid.selectionType to “none”, then use cellClick to detect the click, store the selected state somehow (up to you), and use getCellStyle or other grid styling APIs to cause selected cells to render differently.
Aha…excellent. I was just about to ask this question
Thanks Isomorphic!
Hi Isomorphic,
Thanks for the reply. I have a grid in which none of the cells are editable, in that case selectionType: "none" works fine. But i have a grid where few cells are editable. in that case when i click on a cell which is not editable then nothing is highlighted. Thats good, but the problem arises when i click on a cell which is editable.
When i click on a cell whcih is editable then whole row is getting highlighted.
please help.
my code is:
isc.ListGrid.create({
ID: "StateInfo",
top: 180,
left:210,
width:"80%", height:216, showAllRecords:true,
dataSource: countryDS,
autoFetchData: true,
editEvent: "click",
editByCell: true,
baseStyle: "myBoxedGridCell",
wrapCells: true,
fixedRecordHeights: false,
showRollOver: false,
headerHeight: 60,
selectionType: "none"
});
I just want that cell on which i clicked to edit alone to be highlighted.
Hi Strive,
Hi Isomorphic
I tried, but it is not working :(. I added selectOnEdit: false to my code.
isc.ListGrid.create({
ID: "ProductInformation",
top: 180,
left:10,
width:"20%", height:200, showAllRecords:true,
dataSource: countryDS,
autoFetchData: true,
wrapCells: true,
fixedRecordHeights: false,
showRollOver: false,
leaveScrollbarGap: false,
canResizeFields: false,
bodyOverflow: "hidden",
headerHeight: 60,
baseStyle: "myBoxedGridCell",
selectionType: "none",
canReorderFields: false,
selectOnEdit:false
});
Hi Strive
We’re not reproducing this on our end.
I took your code and made minor modifications to it, so it looks like this:
isc.ListGrid.create({
ID: "ProductInformation",
width:300, height:200, showAllRecords:true,
dataSource: countryDS,
autoFetchData: true,
wrapCells: true,
fixedRecordHeights: false,
showRollOver: false,
leaveScrollbarGap: false,
canResizeFields: false,
bodyOverflow: "hidden",
headerHeight: 60,
editByCell:true,
canEdit:true,
editEvent:"click",
selectionType: "none",
canReorderFields: false,
selectOnEdit:false
});
And then pasted that into the source tab for the “Datasource Fields” example in the 6.0 SDK (which on a standard deployment shows up at http://localhost:8080/isomorphic/system/reference/SmartClient_Explorer.html#dataSourceFields).
I found that when I hit “try it”, and click on a cell to start editing, no selection occurs.
Can you try that test on your end and see what happens?
Thanks
Thanks a lot Isomorphic…
mistake was at my end, its working now…
I’m having trouble this morning getting selectOnEdit: false to work. I’m seeing the issue in both 6.5.1 and 7.0 beta.
If you paste this example into the Data Source Fields demo, double clicking a row does, in fact, select the contents. I’m running FF 3.0.4.
Pete