Grid Choose columns demo
This demo shows how columns can be set/modified at the server side,
feature that is also used in the scheduler demo and array datasource demo.
Id | Person | Food | Location | Date | Price |
679 | Rajesh | Oat meal | Diner | 1/11/2018 | 23 |
683 | Ben | French toast | Tavern | 2/19/2018 | 20 |
687 | Justin | Hot Beverage | Central Perk | 3/1/2013 | 45 |
691 | Courtney | Cheesecake | University | 9/13/2019 | 79 |
695 | Bernadette | Pizza | Tavern | 2/1/2012 | 20 |
699 | Timmy | Shepherd's pie | Visit | 6/9/2014 | 79 |
703 | Claudia | Hot Beverage | University | 10/1/2009 | 21 |
707 | Mateo | Apple | Visit | 5/13/2013 | 45 |
711 | Gabrielle | French toast | Diner | 2/11/2013 | 21 |
715 | Jamie | Cheesecake | Tavern | 10/25/2017 | 100 |
using api
using checkboxlist
note: using persistence Session, try removing some columns, group by a column, and refresh, to mantain the same columns even after reopening browser change to Persistence.Local
Showing how the grid columns can be set/modified in the controller.
The grid has .SendColumns(true) which will send the columns state information on each request, on the first request g.Columns.Length is 0, this is where we set the default column definition. Columns are picked by sending additional parameters using oparams (one time parameters), and by modifying/setting the g.Columns (when g.Columns has Columns in it, the grid will use it instead of what it's specified in the markup). The gridModel.tg is populated with data to be used by the AjaxCheckboxList, on grid aweload event the api of the AjaxCheckboxList is called. Persistence will save the state of the grid ( page, collapsed groups, columns )
The grid has .SendColumns(true) which will send the columns state information on each request, on the first request g.Columns.Length is 0, this is where we set the default column definition. Columns are picked by sending additional parameters using oparams (one time parameters), and by modifying/setting the g.Columns (when g.Columns has Columns in it, the grid will use it instead of what it's specified in the markup). The gridModel.tg is populated with data to be used by the AjaxCheckboxList, on grid aweload event the api of the AjaxCheckboxList is called. Persistence will save the state of the grid ( page, collapsed groups, columns )
Comments