CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

JQGrid Columns selection (show / hide)

by fateh78 » 04 Apr 2017 00:43

Dear CGDevToolers
is there any property in JQGrid to choose visible columns (someting like devexpress grid)

DevExpress Grid Column Selector.png
You do not have the required permissions to view the files attached to this post.
fateh78
 
Posts: 85
Joined: 16 Mar 2017 21:45

by Alexander Bulei » 04 Apr 2017 09:59

Hi fateh78,

s there any property in JQGrid to choose visible columns (someting like devexpress grid)


Yes, please check the JQGridColumnChooser.

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by fateh78 » 07 Apr 2017 10:29

thanks Alexander

i tried to implement my own chooser by using ContextMenu with checkboxes to select visible columns as shown in attached pic.
then used the onhide event of the ContextMenu :
Code: Select all
procedure TMastersBaseForm.cmColumnChooserJQContextMenuOptionsEventsHide(Sender: TObject; AParams: TStringList);
var       i : integer;
begin
  inherited;
  for i := 0 to cmColumnChooser.JQContextMenuOptions.Items.Count-1 do begin
      grdDetailItems.JQGridColumns[i].Hidden := not cmColumnChooser.JQContextMenuOptions.Items[i].TypeCheckboxOptions.Selected;
      HeaderDataSet.Fields[i].Visible := cmColumnChooser.JQContextMenuOptions.Items[i].TypeCheckboxOptions.Selected;
  end;
  //grdDetailItems.AjaxReRender();
  grdDetailItems.JQGridOptions.RemapColumns([0,1,2,3,4,5,6,7,8,9,10], True, False);
end;


but the problem is : "cmColumnChooser.JQContextMenuOptions.Items[i].TypeCheckboxOptions.Selected" does not reflect the selected checkboxes by user.

is this a bug or i missed something ??

best regards
fateh78
 
Posts: 85
Joined: 16 Mar 2017 21:45

by fateh78 » 07 Apr 2017 10:30

i missed the pic
ContextMenu.png
You do not have the required permissions to view the files attached to this post.
fateh78
 
Posts: 85
Joined: 16 Mar 2017 21:45

by Alexander Bulei » 10 Apr 2017 11:24

Hi fateh78,

In this case, you need re-render the contextmenu, because this property doesn't support ajax change.

Best Regards
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal


Return to JQGrid

Who is online

Users browsing this forum: No registered users and 2 guests

Contact Us.