Data Grid - Initial Sort

Forum to discuss the new web client version of Servoy.

Data Grid - Initial Sort

Postby alk » Mon Jan 04, 2021 5:07 pm

Hi,
happy new Year !
and time to start NG Client project,
but questions over questions - hope you can help

First
I use a Data grid with just one column on a form (Dataprovider: bib_testdaten.autor) and inital Sort "name_match asc

But, when datagrid is displayed I have to use the sort-Button,
how can I start in sorted order ?

Thanks,
Best
Ralf
alk
 
Posts: 61
Joined: Wed May 21, 2014 8:34 pm
Location: Berlin

Re: Data Grid - Initial Sort

Postby sean » Wed Jan 06, 2021 5:32 pm

Hi Ralf,

The Data Grid component itself doesn't have an initial sort property. That must be coming from the from property. The data grid is bound to a found set and will control and show what is the sort of the foundset. It could be that the grid is using the form foundset, but sometimes the form's initialSort property is not respected if the foundset is first initialized somewhere else.

You could sort the foundset in onShow(firstShow) event: foundset.sort(sortString,defer)

Hope this helps

Best,
Sean
Software Engineer
Servoy USA
sean
 
Posts: 370
Joined: Mon May 21, 2007 6:26 pm
Location: USA

Re: Data Grid - Initial Sort

Postby rieder » Wed Apr 28, 2021 8:43 am

Hi Sean

Is it possible to defined sort properties for the grid itself? With gridOptions? I find examples in the internet, but can't get it running.

Thank you for any help
and kind regards
Birgit
Birgit Rieder
7r AG, Switzerland
SAN Developer
http://www.seven-r.ch
User avatar
rieder
 
Posts: 177
Joined: Thu Jan 26, 2012 5:18 pm

Re: Data Grid - Initial Sort

Postby sean » Mon May 03, 2021 8:31 pm

Hi Birgit,

Please see the post above. Did you try to sort the foundset ? The grid is bound to a foundset object and that object's state takes precedent because it is controlling how the records are loading from the DB.

Best,
Sean
Software Engineer
Servoy USA
sean
 
Posts: 370
Joined: Mon May 21, 2007 6:26 pm
Location: USA


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 6 guests

cron