Posted 9 July 2018, 4:18 pm EST
When i click on button which fetches data then i am able to see Column headers, is there any way to show column headers when there is not data loaded for grid.
Forums Home / Wijmo / General Discussion
Posted by: rohaanthakare on 9 July 2018, 4:18 pm EST
Posted 9 July 2018, 4:18 pm EST
When i click on button which fetches data then i am able to see Column headers, is there any way to show column headers when there is not data loaded for grid.
Posted 10 July 2018, 9:15 pm EST
Hi,
You can easily show column headers before loading the data by defining columns property of grid.
Please refer to following code snippet
var grid=new wijmo.grid.FlexGrid('#theGrid',{
autoGenerateColumns:false,/* stop grid from generating extra columns when items source is provided */
columns:[ /* define columns for grid */
{header:"ID",binding:"id"},
{header:"Country",binding:"country"},
{header:"Sales",binding:"sales"}
]
});
/* load data later */
You may also refer to the following sample which implements the same:-
https://stackblitz.com/edit/js-pruh9x?file=index.js
~Manish