こんにちは、jqxgrid に取り組んでいます。ローカル json グリッドを使用してこの jqxgrid をロードしようとしています。
以下は、これまでに試したコードです。しかし、空白のグリッドが表示されます。
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="jqwidgets/styles/jqx.base.css" type="text/css" />
<script type="text/javascript" src="scripts/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="jqwidgets/jqxcore.js"></script>
<script type="text/javascript" src="jqwidgets/jqxbuttons.js"></script>
<script type="text/javascript" src="jqwidgets/jqxscrollbar.js"></script>
<script type="text/javascript" src="jqwidgets/jqxmenu.js"></script>
<script type="text/javascript" src="jqwidgets/jqxgrid.js"></script>
<script type="text/javascript" src="jqwidgets/jqxgrid.selection.js"></script>
<script type="text/javascript" src="jqwidgets/jqxgrid.columnsresize.js"></script>
<script type="text/javascript" src="jqwidgets/jqxdata.js"></script>
<script type="text/javascript" src="scripts/gettheme.js"></script>
<script type="text/javascript">
$(document).ready(function () {
var jsonData = [{"creation_dt":"2011-04-08 00:00:00.0","request_deliv_dt":"2011-07-01 00:00:00.0”},
{"creation_dt":"2011-04-08 00:00:00.0","request_deliv_dt":"2011-07-02 00:00:00.0"},
{"creation_dt":"2011-04-08 00:00:00.0","request_deliv_dt":"2011-07-01 00:00:00.0"},
{"creation_dt":"2011-04-08 00:00:00.0","request_deliv_dt":"2011-07-02 00:00:00.0"},
{"creation_dt":"2011-04-08 00:00:00.0","request_deliv_dt":"2011-07-01 00:00:00.0"},
{"creation_dt":"2011-04-08 00:00:00.0","request_deliv_dt":"2011-07-02 00:00:00.0"];
var jsonColumns = [{ text: 'creation_dt', datafield: 'creation_dt', width: 250 },{text:'request_deliv_dt', datafield: 'request_deliv_dt', width: 250 }];
var jsonFields = [{ name: 'creation_dt' },{ name: 'request_deliv_dt' }];
var source ={
datatype: "json",
datafields: jsonFields,
localdata: jsonData
};
var dataAdapter = new $.jqx.dataAdapter(source);
$("#jqxgrid").jqxGrid(
{
width: 670,
source: dataAdapter,
columns: jsonColumns
});
});
});
</script>
</head>
<body class='default'>
<div id='jqxWidget' style="font-size: 13px; font-family: Verdana; float: left;">
<div id="jqxgrid"></div>
</div>
</body>
</html>
上記のコードに問題はありますか..??
誰でも問題を解決するのを手伝ってもらえますか?