jQWidgets Forums

jQuery UI Widgets Forums Grid How to retrieve column information

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

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • How to retrieve column information #5679

    Antony
    Member

    I have a requirement to adjust grid width as user resizes columns. I know that there is no autowidth setting. I want to add up individual column widths and set it as the grid width. I can use getcolumnproperty to get the column width, but dataFieldNames are not known. Can anybody suggest a way to get dataFieldName given the column index.  If there is any other way to automatically set the grid width, please share.

    How to retrieve column information #5690

    Peter Stoev
    Keymaster

    Hi Antony,

    To get the datafield by column’s index, you can use the code snippet below:

    var columnDataField = $("#jqxgrid").jqxGrid('getcolumnat', 0).datafield;

    The above code gets the datafield name of the first column.

    Hope this helps.

    Best Wishes,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    How to retrieve column information #5699

    Antony
    Member

    Thank you very much Peter. I tested and it works.

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

You must be logged in to reply to this topic.