Javascript 禁用jqGrid中的列
我有一个jqGrid:Javascript 禁用jqGrid中的列,javascript,jquery,jqgrid,Javascript,Jquery,Jqgrid,我有一个jqGrid: $("#list").jqGrid({ url: '/modulos/carga/cargaServiciosTarifa.ashx', datatype: 'xml', mtype: 'GET', colNames: ['Tipo_Servicio', 'Cantidad','Unidad'], colModel: [ {name: 'Tipo_Servicio', index: 'TSI_TS_Id', widt
$("#list").jqGrid({
url: '/modulos/carga/cargaServiciosTarifa.ashx',
datatype: 'xml',
mtype: 'GET',
colNames: ['Tipo_Servicio', 'Cantidad','Unidad'],
colModel: [
{name: 'Tipo_Servicio', index: 'TSI_TS_Id', width: 100, align: 'center',
edittype: 'select', editable: true, sortable: true,
editrules: { edithidden: false, required: true }, editoptions: {
size: 1,
dataUrl: '/modulos/carga/cargaServiciosTarifa.ashx?oper=getServicios'
}},
{ name: 'Cantidad', index: 'TSI_Cantidad', width: 100, align: 'center',
editable: true, edittype: 'select', editoptions: {
value: "1:1;2:2;3:3;4:4;5:5;6:6;7:7;8:8;9:9;10:10;11:11;12:12" },
editrules: { edithidden: true }, sortable: true },
{ name: 'Unidad', index: 'TSI_Unidad', width: 100, align: 'center',
editable: true, edittype: 'select',
editoptions: { value: "Dia:Dia;Hora:Hora" }, sortable: true }
],
autoencode: true,
pager: '#pager',
rowNum: 20,
sortname: 'TSI_TS_Id',
sortorder: 'asc',
sortable: true,
autowidth: false,
width: 733,
height: -1,
shrinkToFit: true,
viewrecords: true,
gridview: true,
caption: 'Listado Servicios asociados a Tarifa',
postData: {tarId: tarId.val()},
editurl: '/modulos/carga/cargaServiciosTarifa.ashx'
});
有三个选择选项,我想知道如果我选择了第三个(最后一个)选项“Unidad”中的选项“Dia”,如何禁用“Cantidad”(第二列)选择,但如果我选择了“Hora”选项,则可以使用!当我创建或编辑(无内联编辑)时,是否有可能做到这一点
是否禁用了html之类的属性以添加到colModel
定义中
谢谢。是的,我知道这个选项,但是我想根据另一个选择的值来设置/退出这个选项,这是不一样的!谢谢@bombai:在编辑的情况下,非常重要的一点是明确指定哪种编辑模式(表单编辑、单元格编辑或内联编辑)以及如何使用它。如果您使用
navGrid
,inlineNav
,格式化程序:“操作”
等等,那么指定哪一个很重要。在所有情况下,都可以解决您的问题,但解决方法不同,具体取决于您实现行或单元格编辑的方式。嗨,Oleg,感谢您的回答,我使用navgrid,我忘了指定。你能告诉我怎么修吗?谢谢!