ajax监视已经获取到数据,返回却获取不到数据,请大神指点!!!
var gridManager = null;
var activeDialog = null;
var $grid;
$(function () {
//菜单条
$("#topmenu").ligerMenuBar({ items: [
//{ text: '文件', menu: menu1 },
{text: '导出', menu: menu2 },
{ text: '表格风格', menu: menu3 }
]
});
//搜索
$("#searchbtn").ligerButton({ click: function () {
searchGrid();
}
}).setValue('查询');
//表格
$grid = $("#prigrid").ligerGrid({
columns: [
{ display: '公司编码', name: 'COMPANY_CODE', width: 120 },
{ display: '公司名称', name: 'COMPANY_NAME', width: 120 },
{ display: '公司简介', name: 'COMPANY_PROFILE', width: 120 },
{ display: '企业文化', name: 'ENTERPRISE_CULTURE', width: 80 },
{ display: '公司历程', name: 'FLYING_DRAGON_UNDERGO', width: 120 },
{ display: '公司公告', name: 'COMPANY_PROCLAMATION', width: 220 },
{ display: '公司网站', name: 'URL', width: 60, type: 'int' },
{ display: '预留字段1', name: 'FIELD1', width: 160 },
{ display: '预留字段2', name: 'FIELD2', width: 80 },
{ display: '预留字段3', name: 'FIELD3', width: 80 }
],
dataAction: 'server', sortName: 'COMPANY_CODE',
width: '100%', height: '100%', pageSize: 15, rownumbers: true,
//应用灰色表头
cssClass: 'l-grid-gray', heightDiff: -6,
toolbar: { items: [
{ text: '增加', id: 'add', click: itemclick, icon: 'add' }, { line: true },
{ text: '修改', id: 'modify', click: itemclick, icon: 'modify' }, { line: true },
{ text: '删除', id: 'delete', click: itemclick, icon: 'delete' }
]
}
});
$.ajax({
type: "GET",
contentType: "application/json",
url: "CompanyServer.ashx?action=GETDATA",
dataType: 'json',
success: function (result) {
debugger;
$grid.set({ data: result });
}
});
gridManager = $("#prigrid").ligerGetGridManager();
$("#pageloading").hide();
});
以上为源码,,
调用一般处理程序,已经获得了数据但在
$.ajax({
type: "GET",
contentType: "application/json",
url: "CompanyServer.ashx?action=GETDATA",
dataType: 'json',
success: function (result) {
debugger;
$grid.set({ data: result });
}
});
却获取不了数据,请大神帮我检查下,那块出了问题,这个问题虐的我欲仙欲死!!!! Ajax
[解决办法]
程序里
$.ajax({
type: "GET",
contentType: "application/json",
url: "CompanyServer.ashx?action=GETDATA",
dataType: 'json',
success: function (result) {//result 变量怎么赋值?
debugger;
$grid.set({ data: result });
}
});
$.ajax({
type: "GET",
contentType: "application/json",
url: "CompanyServer.ashx?action=GETDATA",
dataType: 'json',
success: function (result) {
debugger;//这里是干嘛~~~~
$grid.set({ data: result });
}
});