0
我試圖在jqgrid中顯示'添加新記錄'顯示但它不顯示?asp.net mvc 2 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>
您目前0票也許你。。不知道從15個聲望點開始你有投票權在stackoverflow.com上的任何有用的答案或問題。通過在你自己的問題上的答案投票,有簡單的規則描述[這裏](http://stackoverflow.com/faq#howtoask):「當你看到你的問題的新答案,通過點擊向上投票有幫助的指向答案左側的箭頭「。你問了30個問題,並收到了很多答案。答案有幫助嗎?你可以去回答你的舊問題,並投票有用的問題。 – Oleg 2011-03-27 06:51:55