禁用jqGrid中的列

时间:2012-10-26 15:11:42

标签: 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', 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'
});

有三个选择选项,我想知道如何禁用'Cantidad'(第二列)选择我是否选择第三个(最后一个)选项'Dia'作为'Unidad',但可以使用if我选择'Hora'选项!在创建或编辑时没有可能的方法(没有内联编辑)吗?

是否有像html一样的属性可以添加到colModel定义?

感谢。

0 个答案:

没有答案