我正在尝试使用dgrid渲染网格。当我尝试它时,在尝试创建列时抛出错误。我完全按照这个例子,所以我无法弄清楚出了什么问题。任何帮助表示赞赏。
onPostExecute()
尝试OnDemandGrid
require(["dojo", "dojo/dom", "dojo/_base/array", "dijit/registry", "dojo/store/Memory", "dgrid/Grid", "dojo/domReady!"],
function (array, Grid, dom, dojo, registry, Memory, On) {
var xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET", "http://localhost:5944/Home/GetData", true);
xmlhttp.send();
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
data = JSON.parse(xmlhttp.responseText);
GridStore = new Memory({ data: data, idProperty: "_id" });
CreateGrid();
}
}
CreateGrid = function () {
var columns = {
_id: { label: "ID" },
_SectionID: { label: "SpecID" },
_name: { label: "Name" },
_number: { label: "Number" },
_description: { label: "Description" },
_url: { label: "URL" }
};
var grid = new Grid({ columns: columns }, 'editGrid');
grid.renderArray(GridStore);
}