Jump to content

How to dbgrid columsort in runtime?


Freeman35

Recommended Posts

Hello,

How can I set unidbgrid's column(s) sort on form create?

Or I need just set column's order direction glyph? (up or down) 'cos my query has a default "order by" structure, I have to set this to grid, so user can see which column(s) sorted when form opened.

regards.

Link to comment
Share on other sites

function reconfigure(sender, store, columns, oldStore, oldColumns, eOpts)
{
    if (columns[0].isSortable()) {
        columns[0].sort('ASC')
    }
}

This code, remove trigger event.

I have TUniDBText and TUniDBEdit. this components's datasource is same with TUniDBGrid. If Add reconfigure code to grid, this component not triggered, I mean when move grid row, (grid's row change) thşs component's values not change, dbedit's onchange events not triggered too.

What can be wrong?

Link to comment
Share on other sites

6 hours ago, Freeman35 said:

This code, remove trigger event.

I have TUniDBText and TUniDBEdit. this components's datasource is same with TUniDBGrid. If Add reconfigure code to grid, this component not triggered, I mean when move grid row, (grid's row change) thşs component's values not change, dbedit's onchange events not triggered too.

What can be wrong?

It seems I couldn't reproduce your issue.

Can you explain in more details (or by making a simple testcase) ?!

Link to comment
Share on other sites

  • 2 weeks later...
On 1/13/2019 at 9:38 PM, Freeman35 said:

I added just two component and reconfigure function thats all.

Hello,

One possible solution:

procedure TMainForm.UniFormReady(Sender: TObject);
begin
  UniDBGrid1.JSInterface.JSCall('getSelectionModel().resumeEvents', []);
end;

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...