根据同一行中的其他销售价值删除单元格的可编辑 属性
Remove editable property of a cell based on other sell value in the same row
我有一个 JQGrid,如下图所示。
我想,如果用户在 Step Up 列中输入值,则 Step Down 的值将为 0,而 Step Down 列将变为 不可编辑。这样用户就不能在 Step Down 列中输入值。
降压列也应如此。即,如果用户在 Step Down 列中输入值,Step Up 列将变为不可编辑。
我试图在列的编辑选项中使用以下代码来实现此目的,但没有取得太大成功:
{ name: 'stepup', index: 'stepup', align: 'center', width: 250,
sortable: false, editable: true,
editoptions:{dataEvents:[{type: 'change',
fn: function(e){
var setpup_val = $(this).val();
if($.trim(setpup_val)!=""){
$(this).jqGrid('setColProp', 'stepdown', {editable:false});
}
}
}]}},
PS:我正在使用 free-jqgrid/4.15.2
您当前使用 editable
属性 的布尔值:editable: true
。免费的 jqGrid 支持 回调函数。我在 the wiki article 中描述了这种可能性。在我看来,您可以使用该功能轻松实现您的要求。
我有一个 JQGrid,如下图所示。 我想,如果用户在 Step Up 列中输入值,则 Step Down 的值将为 0,而 Step Down 列将变为 不可编辑。这样用户就不能在 Step Down 列中输入值。
降压列也应如此。即,如果用户在 Step Down 列中输入值,Step Up 列将变为不可编辑。
我试图在列的编辑选项中使用以下代码来实现此目的,但没有取得太大成功:
{ name: 'stepup', index: 'stepup', align: 'center', width: 250,
sortable: false, editable: true,
editoptions:{dataEvents:[{type: 'change',
fn: function(e){
var setpup_val = $(this).val();
if($.trim(setpup_val)!=""){
$(this).jqGrid('setColProp', 'stepdown', {editable:false});
}
}
}]}},
PS:我正在使用 free-jqgrid/4.15.2
您当前使用 editable
属性 的布尔值:editable: true
。免费的 jqGrid 支持 回调函数。我在 the wiki article 中描述了这种可能性。在我看来,您可以使用该功能轻松实现您的要求。