After Sorting, paste data is not saving data

Tags: #<Tag:0x00007f34393d55f8>

when I sorted numeric data column and then try to paste data in a string column. I’m not getting pasted row data.

hotConfigurableDetailDataTable.addHook(‘afterChange’, function (change, source) {
if ((source == “edit” || source == “CopyPaste.paste” || source == “UndoRedo.undo”) && (source !== “loadData” && source != “external” && change[0][1] != ‘ID’ && change[0][1] != ‘SiteId’ && change[0][1] != ‘RowOrder’)) {
var prevRowIndex = -1;
if (change.length > 0) {
HotLogicalRowsToPhysical(hotConfigurableDataTable, change[0][0]));
for (var i = 0; i < change.length; i++) {
if (prevRowIndex != HotLogicalRowsToPhysical(hotConfigurableDataTable, change[i][0])) {
ValidateAndSaveConfigurableDetailTablesData(i, change, source);
prevRowIndex = HotLogicalRowsToPhysical(hotConfigurableDataTable, change[i][0]);
}
}
}
}
});
function ValidateAndSaveConfigurableTablesData(index, change, source) {
var rowIndex = HotLogicalRowsToPhysical(hotConfigurableDataTable, change[index][0]);
hotConfigurableDataTable.validateRows(_.toArray({ “temp”: rowIndex }), function (valid) {
var prevName = change[index][2];
if (valid) {
if (!change) {
return;
}
if (change[index][2] != change[index][3]) {
var columnIndex = hotConfigurableDataTable.propToCol(change[0][1]);
if (change[index][3] && change[index][3] == “”) {

            }
            else {
                var sourceRow = hotConfigurableDataTable.getSourceDataAtRow(rowIndex);

///// Team here i’m not getting data for sourceRow.
if (rowToDelete != null) {
sourceRow = rowToDelete;
}
if (sourceRow) {
// Here i want sourceRow data to save
}
}
}
}
});
}

Hi @gdrpradeep30

Could you send a demo? It will be much easier to share a fork of it to debug it together. You an fill it based on this demo https://jsfiddle.net/handsoncode/a3zfd2qc/

Hi @gdrpradeep30

do you still have the same issue?

Hi @aleksandra_budnik I have changed my version to 7.4.1 and it worked perfect.

Thanks

I’m happy to hear that @gdrpradeep30

Thank you for the update.

1 Like