Jump to content
uniGUI Discussion Forums
Sign in to follow this  
Gabriel Fabrega

Undo UniDBGrid Sorting

Recommended Posts

Hello guys!

 

I have a UniDBGrid with some columns with the "Sortable" property enabled and the "OnColumnSort" event scheduled. Basically, I enter the field in the "IndexFieldName" property of TADQuery.

However, I need to clear this order ... Return to the original sort order, which is in the SQL query. Even closing and opening the query and clearing the property "IndexFieldName", prevails the ordering of the column that was clicked.

 

How to clear the ordering of the UniDBGrid columns?

 

Sorry for English. I'm brazilian.

 

Thank you!

Share this post


Link to post
Share on other sites

Hi,

 

Which edition and build are you using?

Share this post


Link to post
Share on other sites

One possible solution maybe:

procedure TMainForm.UniButton1Click(Sender: TObject);
begin
  UniDBGrid1.JSInterface.JSCall('store.sorters.clear', []);
  //UniDBGrid1.JSInterface.JSCall('view.refresh', []);
  
  GridDataSet.Close;
  ...
  GridDataSet.Open;
end;

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×