Author Topic: Local sorting ignores new record  (Read 4208 times)

forwheeler

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 26
    • View Profile
Local sorting ignores new record
« on: December 18, 2013, 08:13:32 pm »
After I add a new record it appears at the bottom of the grid. The local sorting ignores the new record and it remains at the bottom.
Is there a way to either add it to the top or to have the sort work with the new record? I tried to use refresh instead of refreshDataAndView after the push and but it doesn't help.

I do it in this order:
data.push(row)
Add record to database
refreshDataAndView
try to sort new record and it remains at bottom of grid

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Local sorting ignores new record
« Reply #1 on: December 19, 2013, 08:34:14 am »
refreshDataAndView refreshes the sort order.

It works in the following order

reload data -> refresh sort -> refresh view

The closest demo to what you are trying to do is http://paramquery.com/demos/crud_remote

I believe your issue might be related to case sensitivity of strings while sorting by pqGrid. You may need to use custom sort.

forwheeler

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: Local sorting ignores new record
« Reply #2 on: December 19, 2013, 06:41:50 pm »
Yes it was related to case sensitivity. Do you have a demo for a custom sort?

If I upgrade to the pro version will my code remain mostly the same and I can add features later?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Local sorting ignores new record
« Reply #3 on: December 20, 2013, 05:46:54 pm »
Custom sorting demo is here http://paramquery.com/demos/sorting_custom

There are few differences between BASE and PRO version which are mentioned here

http://paramquery.com/pro/tutorial#topic-migration

Please refer to API for details.

http://paramquery.com/pro/api
« Last Edit: December 20, 2013, 05:55:07 pm by paramquery »