我是jqxGrid的新手。我试图在ajax调用PHP文件后填充网格,然后重新加载。 我的代码是:
$(document).ready(function () {
var url = "searchresults.php";
// prepare the data
var source =
{
datatype: "json",
datafields: [
{ name: 'ids', type:"string"},
{ name: 'loc', type:"string" },
{ name: 'name', type:"string"},
{ name: 'tld', type: "string" },
{ name: 'wc', type: "int" }
],
id: 'id',
url: url,
root: 'data'
};
var dataAdapter = new $.jqx.dataAdapter(source);
$("#outgrid").jqxGrid(
{
width: 850,
source: dataAdapter,
//columnsresize: true,
columns: [
{ text: 'IDs', dataField: 'IDs', width: 200 },
{ text: 'LOCATION', dataField: 'loc', width: 200 },
{ text: 'DOMAINS', dataField: 'name', width: 180 },
{ text: 'TLD', dataField: 'tld', width: 90, cellsalign: 'right' },
{ text: 'WORD COUNT', dataField: 'wc', cellsalign: 'right', minwidth: 100}
]
});
});
错误发生在以下行:
$("#outgrid").jqxGrid(
我不明白。 我的依赖是:
<script type="text/javascript" src="js/jquery-1.8.1.min.js"></script>
<link rel="stylesheet" href="jqx/jqx.base.css" type="text/css" />
<script type="text/javascript" src="jqx/jqxcore.js"></script>
<script type="text/javascript" src="jqx/jqxdata.js"></script>
<script type="text/javascript" src="jqx/jqxbuttons.js"></script>
<script type="text/javascript" src="jqx/jqxscrollbar.js"></script>
<script type="text/javascript" src="jqx/jqxmenu.js"></script>
<script type="text/javascript" src="jqx/jqxdatatable.js"></script>