jQWidgets Forums

jQuery UI Widgets Forums Grid JSON format for dynamic column grid

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 9 years, 3 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • JSON format for dynamic column grid #80945

    Kiran
    Participant

    Hi,
    I’m unable to get the valid JSON format for creating dynamic column grid.

    Here is what I have:
    PHP

    $query="select * from mytable";
    $rs = mysql_query($query);
    $rows = array();
    while($r = mysql_fetch_object($rs)) {
        $rows[] = $r;
    }
    echo json_encode($rows);
    
    //Results:
    [{"EmpID":"12345","Name":"James","Account":"New Account1","Group1":"Library","Food_Bill_Date":null,"Food_Bill_Amount":null,"Food_Bill_Number":null},
    {"EmpID":"12346","Name":"David","Account":"New Account2","Group2":"Lab","Food_Bill_Date":null,"Food_Bill_Amount":null,"Food_Bill_Number":null},
    {"EmpID":"12347","Name":"Ramsy","Account":"New Account2","Group2":"Lab","Food_Bill_Date":null,"Food_Bill_Amount":null,"Food_Bill_Number":null},
    ............
    .............
    ............
    ]

    Please help me to format the JSON data for dynamic column grid.

    Thanks,
    Kumar

    JSON format for dynamic column grid #80949

    Peter Stoev
    Keymaster

    Hi Kumar,

    You my look at the Grid’s demos and especially the Binding to JSON demo to learn how to data bind it to JSON data.

    Best Regards,
    Peter Stoev

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

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

You must be logged in to reply to this topic.