mike.tihonchik

Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • in reply to: Load grid with addJSONData problem #92573
    mike.tihonchik
    Participant

    Thank you for that information… However, i am still facing the problem. This is my code:

    jQuery('#terminalGroups').jqGrid({

    datatype: 'json',

    colNames: ['Company','Name','Active'],

    colModel: [

    {name:'company', index:'company', width:500},

    {name:'TG_NAME', index:'TG_NAME', width:300},

    {name:'activeGroup', index:'activeGroup', width:195} ],

    pager: jQuery('#terminalGroupPager'),

    rowNum: 10,

    rowList: [10,20,30],

    sortorder: 'desc',

    viewrecords: true,

    imgpath: 'jquery/jqueryUI/css/sunny/images',

    caption: 'Merchant Groups',

    height: '490px'

    });

    var something = { “data”:[{'company':'1','TG_NAME':'1','activeGroup':'1'},{'company':'2','TG_NAME':'2','activeGroup':'2'}], “totalRows”:2, “totalPages”:1, “page”:1 };

    jQuery('#terminalGroups')[0].addJSONData( something );

    However, I get JS syntax error, and when I debug, it points to this code:

    ($.jgrid.useJSON===true&&typeof(JSON)==="object"&&typeof(JSON.parse)==="function")

    any idea what might that be?

    in reply to: Load grid with addJSONData problem #92539
    mike.tihonchik
    Participant

    Thank you for reply, but I have read that already… The problem is it does not specify much about data array (what should it look like). Here is example data what I use:

    var exmpl = "[{'company':'1','TG_NAME':'1','activeGroup':'1'},{'company':'2','TG_NAME':'2','activeGroup':'2'}]";
    This looks like a proper JS array to me…

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

Stay connected with us in your favorite flavor!