0
안녕하세요 저는이 jQWidgets 그리드 구성 요소를 사용하여 JSON 데이터를로드하고 있습니다. 그러나 어떤 이유로 그것은 빈 행을 데이터가없는 상태로 렌더링하는 것입니다. 이 코드의 문제점을 알려주십시오. 당신은 데이터에 대한 잘못된 이름을 사용하는왜 내 표가 주어진 JSON 데이터로 채워지지 않습니다
http://jsfiddle.net/dRbAE/439/
var data = [{icases__client_id:"15",icases__id:"106167",clients__name:"Apix UK Ltd",icases__case_reference_i_d:"APIX120501",icases__name:"LALO, Hemay",icases__state:"closed",icases__go_date:"2017-01-23T09:43:12"}];
var source =
{
localdata: data,
datafields: [
{name: 'client_id', type: 'int'},
{name: 'case_id', type: 'int'},
{name: 'client_name', type: 'string'},
{name: 'case_ref', type: 'string'},
{name: 'case_name', type: 'string'},
{name: 'case_state', type: 'string'},
{name: 'case_go_date', type: 'date'}
],
id: 'case_id',
datatype: "json"
};
var dataAdapter = new $.jqx.dataAdapter(source);
var cellStyle = function (row, columnfield, value) {
return '';
}
$("#search_case_grid").jqxGrid(
{
width: 1000,
height: 820,
source: dataAdapter,
columnsresize: true,
sortable: true,
editable: false,
altrows: true,
autoheight: false,
rowsheight: 20,
selectionmode: 'single row',
editmode: 'selectedcell',
columns: [
{hidden: true, datafield: 'icases__id', width: 0},
{text: 'Client', datafield: 'clients__name', align: 'center', width: 250, cellclassname: cellStyle},
{text: 'Case Ref.', datafield: 'icases__case_reference_i_d', align: 'center', width: 100, cellclassname: cellStyle},
{text: 'Case', datafield: 'icases__name', align: 'center', width: 150, cellclassname: cellStyle},
{text: 'State', datafield: 'icases__state', align: 'center', width: 100, cellclassname: cellStyle},
{text: 'Go Date', datafield: 'icases__go_date', align: 'center', columntype: 'datetimeinput', formatString: "dd-MM-yyyy", cellsformat: "dd-MMMM-yyyy", width: 100, cellclassname: cellStyle}
]
});
<link href="https://jqwidgets.com/public/jqwidgets/styles/jqx.energyblue.css" rel="stylesheet"/>
<link href="https://jqwidgets.com/public/jqwidgets/styles/jqx.base.css" rel="stylesheet"/>
<script src="https://jqwidgets.com/public/jqwidgets/jqx-all.js"></script>
<div id='search_case_grid'>
</div>
고마워요. 정말 어리석은 실수였습니다. –
문제 없으므로 잘 작동합니다! : D – rick
p.s. 대답을 받아 들일 수 있습니까? – rick