【发布时间】:2012-11-29 23:44:52
【问题描述】:
好的,我回来了,我刚刚删除了格式化程序:“select”,它需要匹配的状态键才能在网格中显示。
好吧我放弃了,我的解决办法是:
搜索:false,可编辑:false
直到 JQGrid 的新版本。
好的,所以看看 Oleg 的代码,似乎解决方案是最初用所有国家/地区的每个可能值填充州选择。鉴于我要处理很多“状态”(全球),为了找到与实际单元格值匹配的状态,下拉 3-4000 个状态有点笨拙。仍在努力。
我有依赖国家和州的下拉菜单(工具栏搜索、内联编辑和表单编辑)。我在 datainit 函数中获取行 ID 时遇到问题,因此我可以从 state searchoptions/editoptions 的 datainit 函数中检索国家/地区值。
肯定有办法找回这个吗?我也尝试设置超时,但没有运气:
{ name: "State", index: "MYSTATE", width: 50, align: "left", editable: true, formatter: "select", stype: "select", edittype: "select", sortable: true, editrules: { required: true, custom: true, custom_func: validateState },
searchoptions:
{
value: GetStates('NG', true), // just hardcoded here for now
dataInit: function (elem)
{
var rowId = $(elem.target).closest('tr.jqgrow').attr('id');
var country = grid.jqGrid('getCell', rowId, 'Country');
...
谢谢。
【问题讨论】: