Jump to content


Photo

Undo UniDBGrid Sorting

UniDBGrid Sorting Clear

  • Please log in to reply
8 replies to this topic

#1 Gabriel Fabrega

Gabriel Fabrega

    Newbie

  • uniGUI Subscriber
  • Pip
  • 7 posts

Posted 03 May 2018 - 07:37 PM

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!

  • 0

#2 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 5199 posts

Posted 04 May 2018 - 02:19 AM

Hi,

Which edition and build are you using?
  • 0

#3 Gabriel Fabrega

Gabriel Fabrega

    Newbie

  • uniGUI Subscriber
  • Pip
  • 7 posts

Posted 04 May 2018 - 11:25 AM

Hi Delphi Developer

 

1.0.0.1424


  • 0

#4 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 5199 posts

Posted 04 May 2018 - 11:29 AM

Hi,

 

Trial edition or ?


  • 0

#5 Gabriel Fabrega

Gabriel Fabrega

    Newbie

  • uniGUI Subscriber
  • Pip
  • 7 posts

Posted 04 May 2018 - 12:03 PM

I have an official license


  • 0

#6 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 5199 posts

Posted 04 May 2018 - 12:12 PM

First of all please visit here:

http://forums.unigui...-email-address/


  • 0

#7 Gabriel Fabrega

Gabriel Fabrega

    Newbie

  • uniGUI Subscriber
  • Pip
  • 7 posts

Posted 04 May 2018 - 12:27 PM

Sorry. I already adjusted.


  • 0

#8 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 5199 posts

Posted 04 May 2018 - 12:45 PM

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;

  • 0

#9 Gabriel Fabrega

Gabriel Fabrega

    Newbie

  • uniGUI Subscriber
  • Pip
  • 7 posts

Posted 04 May 2018 - 04:55 PM

Worked perfectly. Thank you!


  • 0





Also tagged with one or more of these keywords: UniDBGrid, Sorting, Clear

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users