1

I have a dGrid component in my application. In it I have custom sorting method.

var grid = new (declare([Grid, Pagination]))({
        store: new Memory({ data: data, idProperty: 'id' }),
        columns: columns,
        pagingLinks: 1,
        pagingTextBox: true,
        firstLastArrows: true,
        pageSizeOptions: [10, 15, 25]
    }, 'domID');

grid.on('dgrid-sort', function (event) {
                event.preventDefault();
                grid.set('sort', function (a, b) {
                    *sorting logic*
                grid.updateSortArrow(event.sort, true);
            })

My dGrid sorts itself just like I need it to. But now I have problem with paging. When I change page in my dGrid, it goes back to standard sorting from array prototype. Any ideas what to do?

K.Broncel
  • 79
  • 6

1 Answers1

0

It is preferable to implement your custom sorting logic in the store. In that way the logic will be always applied. For details refer to this question: Non case-sensitive sorting in dojo dgrid

Community
  • 1
  • 1
pgianna
  • 715
  • 1
  • 7
  • 16