Jump to content

TUniDBGrid: How do I save column visibility in a cookie


cdev

Recommended Posts

Hi

I can save the column widths of a grid in a cookie.  Next time the user loads the application he gets his grid with the same column widths as he left the application.  I save the column width information in the OnColumnResize event handler of the grid and I load the column width information in the OnAfterLoad event handler of the grid.

Now, I want to do the same for the columns that are marked invisible or visible in runtime.  But I don't know in what event handler I can catch this.

Anyone has a clue how I could achieve this ?

Link to comment
Share on other sites

OK, I can catch these events in the ClientEvents columnhide and columnshow.    But now I have a new question: I have a global boolean in my unit bColumn0Visible.  How can I set that boolean to True or False from within these ClientEvents ?

Link to comment
Share on other sites

Yes, I want to store the column visibity of each column in cookies.  When next time the user gets back to the grid, he gets his grid with the same visible columns as the previous time.

Link to comment
Share on other sites

8 hours ago, Sherzod said:

Do you want to read this value from the clientside? 

You can assign your value to a new property ...

procedure TMainForm.UniFormCreate(Sender: TObject);
begin
  UniDBGrid1.JSInterface.JSAssign('needToSave', [True]);
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...