0
$("#list").jqGrid({
url: '/modulos/carga/cargaServiciosTarifa.ashx',
datatype: 'xml',
mtype: 'GET',
colNames: ['Precio Dia', 'Precio Hora','Unidad'],
colModel: [
{ name: 'preciodia', index: 'preciodia', width: 100, align: 'center', editable: true, sortable: false },
{ name: 'preciohora', index: 'preciohora', width: 400, align: 'center', editable: true, sortable: false },
{ 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: 'preciohora',
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'
});
//Paginador
jQuery("#list").jqGrid('navGrid',
'#pager',
{
alerttext: "Seleccione un precio.",
add: true, addtitle: "Crear precio",
del: true, deltitle: "Eliminar precio",
edit: true, edittitle: "Modificar precio",
search: false, searchtitle: "Búsqueda",
refresh: true,
cloneToTop: true
},
{ width: 360, resize: false, closeAfterEdit: true, recreateForm: true, viewPagerButtons: true },
{ width: 360, resize: false, closeAfterAdd: true, recreateForm: true, viewPagerButtons: true },
{ }, //Delete action
{ closeAfterSearch: true, closeOnEscape: true }
);
有兩個文本框和一個選擇選項,我想知道如何禁用'Precio Dia'(第一個文本框)列,如果我選擇選項'Hora'select(第三列),另一種方式禁用'Precio Dia',如果我在選擇中選擇'Hora'!有沒有可能的方式來做到這一點,當我創建或編輯(沒有內聯編輯,我使用navGrid)?在Jqgrid中禁用輸入列
有沒有像HTML禁用的任何屬性可以添加到colModel定義?
謝謝。
嗨奧列格,我想我即將修復它,但螢火蟲告訴我,道具不是一個函數。你知道真的發生了什麼嗎?再次感謝。 – bombai
@bombai:不客氣!看看[工作演示](http://www.ok-soft-gmbh.com/jqGrid/bombai.htm)並與您的代碼進行比較。您還應該在包含XML數據的服務器響應的HTTP標頭中驗證「Contain-Type」是「text/xml」。 – Oleg
好的,我已經修復,是由jquery的版本,我的項目是1.4.3,並且道具不存在,我已經使用'$(#input).attr('disabled','disabled');只適用於jquery1.6或+!再次感謝! – bombai