bruno65 Posted February 22 Share Posted February 22 Hi, i tried to enable/disable sort header column menu in uniDBGrid with adding a checkbox named "Tri". For that i added a client event function beforerender(sender, eOpts) { var currentHeaders = this.headerCt.getMenu(); // ajoute le menu pour le tri et le filtre currentHeaders.add( [ { itemId: 'checkSortMenuItem', text: 'Tri', checked: false, handler: function() { currentHeaders.hide(true); ajaxRequest(sender, 'OnTriChange', ['checked='+this.checked.toString()]); } } ] ); } and a server event procedure TMainForm.IUMGrid1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); var ShowFilter: Boolean; ShowSortOrder: Boolean; I: Integer; begin if (EventName = 'OnTriChange') then begin ShowSortOrder := StrToBool(Params.Values['checked']); for I := 0 to IUMGrid1.Columns.Count - 1 do IUMGrid1.Columns.Items[I].Sortable := ShowSortOrder; IUMGrid1.Refresh; end; end; But the sort header column menu is always disabled even if the "Tri" checkbox is checked So what is wrong in my code ? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 22 Share Posted February 22 Hello, 1 hour ago, bruno65 said: currentHeaders.hide(true); Why are you calling the hide method? And why do you need this behavior? Quote Link to comment Share on other sites More sharing options...
bruno65 Posted February 22 Author Share Posted February 22 i call currentHeaders.hide(true); because if i don't do that the popup menu never disappears even if i click anywhere on the screen (with uniGUI 1.90.0 build 1568 Pro) I'd like an checkbox in this popup menu for the user to enable or not sorting all columns (is disabled by default) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.