When select multiple cells in a column and press "enter" to update these cells, if selection is from top to bottom, one more unselected cell on the top is also updated. If selection is from the bottom to top, the correct number of cells updated but updated cells are not the selected.
Is there anything wrong in the code?
Thanks,
*************************************
name:'Updating',
enableAddRow:true,
editMode: "cell",
startEditTriggers: "dblclick,F2, enter",
editCellEnded: editCellEndedHandler,
...
function editCellEndedHandler(event, args) {
if (args.value != args.oldValue && args.value != null) {
var columnKey = args.columnKey;
var rowIndex = args.rowID;
var value = args.value;
var cells = $('#grid').igGridSelection('selectedCells');
var len = cells.count();
for (var i = 0; i < len; i++) {
var cell = cells[i];
if (rowIndex != cell.rowIndex) {
$("#grid").igGridUpdating("setCellValue", cell.rowIndex, cell.columnKey, value);
}
*************************
Hi,Your code looks good.I created a sample and it works for me. It is attached to this forum post.The problem should be somewhere else, maybe other part of configuration.What version(and build number) of NA for jQuery controls do you use?In which browser you are experiencing the issue?
Best regards,Martin PavlovInfragistics, Inc.
Thanks.
Yes. Your code does work.
I use IE 9 and
* Infragistics.Web.ClientUI Util functions 12.1.20121.1010
*
* Copyright (c) 2011-2012 Infragistics Inc.
* util functions that extend the jQuery namespace
* if something is not already available in jQuery, please add it here.
* http://ko.infragistics.com/
* Depends on:
* jquery-1.4.4.js
Thanks for the answer.
Acturally, I did not use args.rowID as rowIndex. I just used primaryKey and cell.rowIndex to update the cell. In this case, it is OK if the primaryKey values match the cell.rowIndex, otherwise, it is not correct.
Best regards,
Hi,
I found the problem. You used the args.rowID as rowIndex which is not correct.
I modified my sample so it takes the rowID from the cell (cell.row.attr('data-id')) instead of cell.rowIndex.
Here is the editCellEndedHandler:
Martin Pavlov
Infragistics, Inc.
I think it is because the grid updates the cells based on rowindex which uses the primarykey. You can repeat this if you change your code from
gridData[i] = { 'ProductID': i,
to
gridData[i] = { 'ProductID': i+1,