Reverse sort by Grid View

I have a problem with sorting. When I go to the Grid View I want to see the events by date in ascending order, however the Scheduler by default put it in descending order and I’m unable to change it. This is what I have:

scheduler.createGridView({
       name:"grid",
       fields:[    // defines columns of the grid
             {id:"start_date", label:'Fecha Inicio', sort:reverseSort, width:200},
             {id:"end_date", label:'Fecha Fin', sort:'date', width:200},
             {id:"text", label:'Texto', sort:'str',  width:200, align:'left'}
       ],
});
function reverseSort(a,b){
    a = a.start_date;
    b = b.start_date;
    return a<b?1:-1;
}

Regardless if I put:

return a<b?1:-1;

or

return a>b?1:-1;

it still does the same (descending order).
What do I do wrong?

Ok, forget it. I haven’t realized before that even though I cannot set a different sort by default, it’s just one click if I want to change it, so it’s good enough for me.

…Still…I am facing a similar issue. Is there any way to automatically sort the grid when it is displayed/refreshed ?
Thanks !

Hello.
I have the same problem.
Did anyone solve this?

Hi,
unfortunately, the current version of the component does not provides a public settings neither for triggering sorting of the grid, nor for setting the default sorting.

Right now the only available way to sort grid on demand, that not includes modifying the source codes of component and using the private methods (that most probably will be changed in the next version),
is to manually invoke the click event on the header of the appropriate column. E.g.: document.querySelector(".dhx_cal_header .dhx_grid_line div:nth-child(2)").click();