我正在调用函数GetGrid_Data()
来加载jqGrid ......但没有运气。
这是在模态对话框中加载内容的方式,如果没有请建议方式。提前谢谢。
function ClickFirstName() {
$('.GetLink').click(function () {
$('#dialog-box').dialog({
title: "Ageing details",
modal: true,
draggable: false,
width: '50%',
height: 500,
open: function(){
GetGrid_Data();
},
buttons: {
"Close": function () {
$(this).dialog("close");
}
}
});
});
//Get_Dialog();
}
function GetGrid_Data() {
alert("Hello");
$('#grid2').jqGrid({
data: pateintsData,
datatype: 'local',
colNames: ['Speciality', 'LIP', 'Days', 'PLA'],
colModel: [
{ name: 'Speciality', index: 'Speciality', width: 200, align: 'center' },
{ name: 'LIP', index: 'LIP', align: 'center', width: 200, editable: true },
{ name: 'Days', index: 'Days', align: 'center', width: 200, editable: true },
{ name: 'PLA', index: 'PLA', align: 'center', width: 300, editable: true }
],
//onSortCol: function (name, index) { alert("Column Name: " + name + " Column Index: " + index); },
sortname: 'Speciality',
editurl: "clientArray",
sortorder: 'asc',
scrollOffset: 0,
gridview: true,
hidegrid: false,
height: 680,
shrinkToFit: true,
altRows: true,
altclass: 'myAltRowClass',
viewrecords: true
});
}
});
答案 0 :(得分:0)
根据您的代码,您必须将对话框附加到html正文。尝试执行以下操作:
$('.GetLink').click(function () {
var $div = $('<div id="dialog-box"> +
'<div id="grid2Div">' +
'<table id="grid2"></table>' +
'<div id="grid2"></div></div></div>';
$('body').append($div);
$('#dialog-box').dialog({
让我们知道它是否有效。干杯!