gridjs
gridjs copied to clipboard
[Feature request] Initial sorting / Sort methods
Hello,
Is your feature request related to a problem? Please describe. I would like if it where possible to programatically define the sorting on a table, at least the initial one like mentionned in #954.
Describe the solution you'd like Parameters to define the initial sorting like in jQuery DataTables or a method.
Describe alternatives you've considered I haven't yet found a way to do this.
Thank you!
I also have the same problem. My table is sorted by default ASC. When a user clicks on sort it sorts again with ASC first.
Don't want this to be auto-closed, so I'll just say: yes, this would be great. Shouldn't it just be a matter of adding a public API method which takes an array of column names and sort directions and sends a series of requests to this method?
would like this
This would be great indeed
this would be helpful
I'd actually like to see this on the Grid config object. Currently the sort
property is either boolean or this object:
{
multiColumn?: boolean;
server?: {
url?: (prevUrl: string, columns: TColumnSort[]) => string;
body?: (prevBody: BodyInit, columns: TColumnSort[]) => BodyInit;
};
}
I think it would be awesome if we could just add a property like this:
{
multiColumn?: boolean;
server?: {
url?: (prevUrl: string, columns: TColumnSort[]) => string;
body?: (prevBody: BodyInit, columns: TColumnSort[]) => BodyInit;
};
initialSort?: {
columnId: string;
direction?: 'asc' | 'desc';
}
}
I'd like to add @joeskeen's idea of an array of {columnId: string, direction?: 'asc' | 'desc'}
to handle multi column sorting using the initial config.