jQuery UI Widgets › Forums › Grid › Get DataColumns, DataField and ColumnGroup
Tagged: angular grid, column, columngroup, datafield, DataField and ColumnGroup, get, Get DataColumns, getcolumnproperty, grid, jquery grid, jqxgrid, property
This topic contains 7 replies, has 2 voices, and was last updated by Dimitar 9 years, 3 months ago.
-
Author
-
I know we can take the columns of a JQX grid as,
`$(“#advancedgrid”).jqxGrid(“columns”)
But what about DataField and ColumnGroup? Please share me how to get those details.Kindest Regards
Sibeesh Venu
http://sibeeshpassion.com/Hello Sibeesh Venu,
You can use the method getcolumnproperty (example).
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Hi Dimitar,
Thanks a lot for your reply.
If we use `$(“#advancedgrid”).jqxGrid(“columns”) we will get an array which contains data fields of all the columns right? I need to get a method something like that.
It seems we need to pass each column datafields to the ‘ $(‘#jqxgrid’).jqxGrid(‘getcolumnproperty’) . Since I am using dynamic data and values. It is bit tough to pass all the values one by one. So is there any method available which returns all the info about the data fields ? If yes please share me. Thanks in advanceKindest Regards
Sibeesh Venu
http://sibeeshpassion.com/Hi Sibeesh,
Unfortunately,
$("#advancedgrid").jqxGrid("columns")
does not return an array of all columns. Perhaps if you show us how you generate your columns array (which you pass in the grid settings), we may better be able to assist you. Remember to format the code you post here by selecting it and clicking thecode
button in the toolbar.Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Hi Dimitar,
Thank you for your reply. Here by I am pasting my codes.
var cols = $("#advancedgrid").jqxGrid("columns"); sessionStorage.setItem('DataColumns', JSON.stringify(cols));
And in the grid setting I gave
width: '99.8%', source: dataAdapter, columns: DataColumns,
getcolumn method returns a JSON object.
Kindest Regards
Sibeesh Venu
http://sibeeshpassion.com/Hi Sibeesh,
I am not sure I understand your scenario. What is the value of the array DataColumns? Could you, please, post your complete source definition and grid initialization code?
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Hi,
I am setting DataColumns as follows.var DataColumns=sessionStorage.getItem('DataColumns');
I just need the columngroup information after the grid is loaded, so that I can save that as a json and retrieve in edit mode. Is there any way? Please help me.
Hi Sibeesh,
This information is insufficient for us. As I said in my previous post, we would need your complete source definition and grid initialization code. Or you can try getting the datafields from the grid’s source object, which should be accessible in edit mode.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.