JqGrid的问题和问题
Questions About and Issues With JqGrid
我确信我的问题已经在某个地方得到了解决,但我已经研究了一段时间,似乎找不到我想要的答案。
- 使用inlineNav功能时,是否有"删除"选项?我还没有找到,所以为了使用它,我必须使用
navGrid
和inlineNav
功能创建网格,如下所示:
$("#attributeEditList").jqGrid( {
datatype: "local",
height: 150,
colNames: ['rowid', 'Vendor', 'Category', 'Key', 'Value', 'Flags', 'Status'],
colModel: [
{name: 'rowid', index: 'rowid', hidden: true, key: true},
{name: 'vendorCode', index: 'vendorCode', hidden: true},
{name: 'category', index: 'category', width: 120, editable: true, editrules:{required: true} },
{name: 'key', index: 'key', width: 120, editable: true, editrules:{required: true} },
{name: 'value', index: 'value', width: 200, editable: true, editrules:{required: true} },
{name: 'flags', index: 'flags', width: 80, editable: true, editrules:{required: true, integer: true} },
{name: 'status', index: 'status', hidden: true }
],
sortname: "category",
viewrecords: true,
caption: "Attributes",
rowNum: 20000,
pager: '#attributeEditPager',
editurl: "vendor/ajax/dummy.do",
data: vendor.attributes,
jsonReader : { repeatitems: false }
});
$("#attributeEditList").jqGrid( "navGrid", '#attributeEditPager', {
edit: false,
add: false,
del: true,
search: false,
refresh: false,
delfunc: deleteAttribute
}
);
$("#attributeEditList").jqGrid( "inlineNav", '#attributeEditPager' );
- 有没有任何方法可以在网格中进行严格的客户端编辑?我希望我的用户能够进行几次编辑(添加/编辑/删除),然后将网格中的所有更改,以及网格外的一些其他形式的更改,原子式地发布回服务器。据我所知,
editurl
参数是必需的,而且必须是有效的url,才能进行编辑 - 最后,我认为这是我遇到的最大问题,是在使用
inlineNav
功能时。首先,我单击"添加(+)"按钮添加一行,添加数据,然后单击"保存"按钮。然后,如果我再次单击"添加"按钮,则会添加新行,但"添加"answers"编辑"按钮仍处于活动状态,而"保存"answers"取消"按钮仍被禁用
如果你对这些问题有什么建议,请告诉我。
看看旧答案中的演示,我在其中演示了如何在jqGrid中实现本地表单编辑。您的第一个问题是关于navGrid
添加的"删除"。所以你可以使用设置processing: true
的技巧,我建议让"删除"按钮在本地工作。您应该另外使用editurl: 'clientArray'
。大约一年前,我向trirand发布了我的建议(见此处),但本地表单编辑仍然不是jqGrid的一部分。
你说得对,inlineNav
在很多情况下都会出错,如果用户按其他顺序点击按钮,就会出现错误激活或错误停用的按钮。您必须使用$("#attributeEditList_ilsave").removeClass('ui-state-disabled');
或$("#attributeEditList_ilsave").addClass('ui-state-disabled');
手动激活/停用按钮。按钮的id将由网格和后缀"_iladd"、"_iledit"、"_idsave"answers"_ilcancel"构成。我建议你在onSelectRow
或beforeSelectRow
中包含这样的代码,直到jqGrid的主代码中没有修复这些错误。
相关文章:
- jqGrid树网格问题
- jqGrid中的gridComplete问题
- 在jqGrid编辑对话框中使用ptTimeSelect时出现问题
- jqgrid 中的 if-else 条件出现问题
- 使用滚动重新加载 Jqgrid 时出现问题 - 重复的行数据并缺少最后一页
- jqGrid + 引导多选可见性问题
- jqGrid TreeView嵌套问题
- JqGrid的问题和问题
- 动态jqGrid的水平滚动条问题
- jqGrid可编辑问题
- jqGrid与IE11的问题-当用户从可编辑单元格中弹出选项卡时,第一个键输入忽略
- jqgrid中分组行折叠和扩展的问题
- 我在jqGrid中动态构建的colModel有什么问题?
- jqGrid 4.4.5 Chrome中网格列宽度渲染问题
- jqgrid中的排序问题
- jqGrid分页问题
- jqGrid:我的JSON有什么问题
- jqGrid排序问题id名称和索引不同
- 编辑行时动态 colModel 的 jqGrid 出现问题
- jQGrid事件viewGridRow的顶部和左侧选项的问题,无法解析光标位置