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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...