jQWidgets Forums

jQuery UI Widgets Forums Grid Setting inner property to Column in Grid

Tagged: ,

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

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Setting inner property to Column in Grid #10208

    Ashish
    Member

    Hello,

    I have

    Table structure like

    Employee

    {

    string FirstName;

    string LastName;

    string MiddleName;

    Address address;

    }

    Address

    {

    sring City;

    string State;

    }

    Now using jqxGrid. I need to display City and State also in my grid

    I am able to display FirstName and LastName.

    var source = {
    datatype: “json”,
    datafields:
    [
    { name: ‘FirstName’ },
    { name: ‘LastName’ },
    { name: ‘BirthDate’, type: ‘date’ },
    { name: ‘City’},
    { name: ‘State’ },

    ],
    url: ‘Employee/GetAllEmployeeDetails’
    };

    $(“#jqxgrid”).jqxGrid({
    source: source,
    theme: ‘classic’,
    sortable: true,
    width: 600,
    autoheight: true,
    pageable: true,
    columnsreorder: true,
    columns:
    [
    { text: ‘First Name’, datafield: ‘FirstName’, width: 150 },
    { text: ‘Last Name’, datafield: ‘LastName’, width: 150 },
    { text: ‘Birth Date’, datafield: ‘BirthDate’, width: 100, cellsformat: “dd/MM/yyyy” },
    { text: ‘City’, datafield: ‘City’, width: 100 },
    { text: ‘State’, datafield: ‘State’, width: 100 }

    ]
    });

    Please suggest me how could I proceed to show City and State data in my grid?

    Regards
    Ashish

    Setting inner property to Column in Grid #10217

    Peter Stoev
    Keymaster

    Hi Ashish,

    Please, take a look at the datafields mapping in this help topic: jquery-grid-datasources.htm. It demonstrates how to display nested JSON or XML fields in the Grid.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Setting inner property to Column in Grid #10220

    Ashish
    Member

    Thanks

    That helped 🙂

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

You must be logged in to reply to this topic.