Я пытаюсь отобразить экран «Добавить новую запись» в jqgrid, но он не отображается?
<script type="text/javascript">
jQuery(document).ready(function () {
$("#addBtn").click(function () {
$("#list").jqGrid('editGridRow', "new", { height: 280, reloadAfterSubmit: false });
});
var lastsel;
$("#list").jqGrid({
url: '/Home/DynamicGridData/',
datatype: 'json',
mtype: 'GET',
colNames: ['IdNr', 'Id', 'FirstName', 'LastName'],
colModel: [
{ name: 'IdNr', index: 'IdNr', width: 40, align: 'left',
editable: true, editrules: { edithidden: true }, hidden: true
},
{ name: 'Id', index: 'Id', width: 40, align: 'left',
editable: false
},
{ name: 'FirstName', index: 'FirstName', width: 200, align: 'left', editable: true, edittype: 'text', editoptions: { size: 20, maxlength: 30} },
{ name: 'LastName', index: 'LastName', width: 300, align: 'left', editable: true, edittype: 'text', editoptions: { size: 20, maxlength: 30}}],
onSelectRow: function (id) {
if (id && id !== lastsel) {
jQuery('#list').restoreRow(lastsel);
jQuery('#list').editRow(id, true);
jQuery("#grid_id").editGridRow(id, options);
lastsel = id;
}
},
editurl: "/Home/GridSave",
pager: jQuery('#pager'),
rowNum: 10,
rowList: [5, 10, 20, 50],
sortname: 'Id',
sortorder: "desc",
viewrecords: true,
imgpath: '/content/themes/steel/images',
caption: 'Employees'
});
});
</script>
<table id="list" class="scroll" cellpadding="0" cellspacing="0"></table>