Author Topic: After sort changes are not in the add list for new rows(sorting for empty rows)  (Read 2151 times)

cijojohn

  • Pro Ultimate
  • Jr. Member
  • *
  • Posts: 73
    • View Profile
Hi Team,

we have used the solution of detaching the empty rows from dataModel.data in beforeSort and append it back in sort event. As mentioned in the below link.

https://paramquery.com/forum/index.php?topic=953.0


In our case, empty rows are the one, that we add default (say 5- new rows in bottom)to the grid during creation of our grid.

Now if we sort any column in grid(grid is not dirty yet),  and then change the any column in the newly added row, the grid is not giving the changes. The below is the function we are using to get changes

$griId.pqGrid("getChanges", {
      format : 'byVal',
      all : true
   });

However, if change any cell value in newly added row and then sort, the grid gives the changes.

Behavior is strange. please suggest. Share js fiddle if possible.

the version we are using ParamQuery Pro v3.3.5.


« Last Edit: January 10, 2018, 04:39:24 pm by cijojohn »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6307
    • View Profile
I'm looking into it.

It may take a while as it's a non-trivial case and you haven't shared your implementation code.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6307
    • View Profile
I was not so confident that it would work because directly manipulating grid data with splice or push is not good or recommended when tracking is on in the grid.

But it works fine as can be seen in this plnkr:

https://plnkr.co/edit/zrxsNJ6ajoXA5JBbDn19?p=preview