jQuery UI Widgets Forums Grid Get DataColumns, DataField and ColumnGroup

This topic contains 7 replies, has 2 voices, and was last updated by  Dimitar 8 years, 8 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author

  • Sibeesh Venu
    Participant

    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/


    Dimitar
    Participant

    Hello Sibeesh Venu,

    You can use the method getcolumnproperty (example).

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/


    Sibeesh Venu
    Participant

    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 advance

    Kindest Regards
    Sibeesh Venu
    http://sibeeshpassion.com/

    • This reply was modified 8 years, 8 months ago by  Sibeesh Venu.

    Dimitar
    Participant

    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 the code button in the toolbar.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/


    Sibeesh Venu
    Participant

    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/


    Dimitar
    Participant

    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,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/


    Sibeesh Venu
    Participant

    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.


    Dimitar
    Participant

    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,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.