jQuery UI Widgets Forums Getting Started jQWidgets Grid Columns

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

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • jQWidgets Grid Columns #105117

    Jajabailio
    Participant

    Salutations!

    I’m fairly new here, but I wanted to ask if there’s a way in jqxGrid where I can display in a single column, two datafields.
    Example: having my datafields
    datafields: [
    { name: ‘firstname’, map: ‘name>firstname’},
    { name: ‘lastname’, map: ‘name>lastname’},
    { name: ‘age’ },
    { name: ‘birthday’ }
    ],
    // and then in the jqxGrid columns
    columns: [
    { text: ‘Name’, datafield: ‘firstname’, displayfield: ‘lastname’, width: ‘20%’ }
    ]

    I wanted to display the ‘firstname’ and the ‘lastname’ in the column ‘Name’ together. I’ve been stuck at this for a day, please help.

    Thank you!

    jQWidgets Grid Columns #105121

    Peter Stoev
    Keymaster

    Hi Jajabailio,

    You can use the Grid’s cellsrenderer column function to achieve that. Please, refer to: https://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/computedcolumn.htm?light. The ‘Totals’ column is using values from the ‘Price’ and ‘Quantity’ columns. Same approach can be applied in your case.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    https://www.jqwidgets.com

    jQWidgets Grid Columns #105125

    Jajabailio
    Participant

    Thank you very much, Mr. Stoev!

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

You must be logged in to reply to this topic.