I’m using json data below for flexigrid, but it doesn’t work.
json.txt
{‘page’:1, ‘total’:1, ‘rows’:[{‘id’:1, ‘cell’:[‘S1’, ‘H’, ‘Jerry’]}, {‘id’:2, ‘cell’:[‘S1’, ‘H’, ‘Terry’]}]}
javascript:
$('#idefectreport').flexigrid({
url: 'json.txt',
dataType: 'JSON',
colModel: [
{display: 'DefectID', name : 'id', width : 40, sortable : true, align: 'center'},
{display: 'Priority', name : 'priority', width : 180, sortable : true, align: 'center'},
{display: 'SupportID', name : 'supportid', width : 120, sortable : true, align: 'center'}
],
buttons : [
{name: 'Add', bclass: 'add'},
{name: 'Delete', bclass: 'delete'},
{separator: true}
],
searchitems : [
{display: 'DefectID', name : 'id'},
{display: 'Priority', name : 'priority', isdefault: true}
],
height:'auto',
sortname: "id",
sortorder: "asc",
title: 'Defect Report',
usepager: true,
useRp: true,
rp: 10,
showTableToggleBtn: true
});
what’s wrong with the code? thanks!
your json format is incorrect, the single quote should be a double quote for strings