我有一個jqGrid,其中包含要在表單中編輯的用戶信息。用戶名是不可變的,但應該出現在表單中,以便用戶知道他們正在編輯哪個用戶。密碼只能編輯。所以在我的colModel我有這樣的設置:如何在jqGrid中添加和編輯表單的不同編輯選項
{name:'username', index:'username', width:155, editable:true, editoptions: {readonly:'readonly'}},
{name:'password', index:'password', width:155, hidden:true, editable: true, edittype:'password', editrules:{edithidden:true}},
這適用於編輯。我的問題是添加我需要使用戶名'不只讀'。我沒有看到屬性來控制添加窗體與編輯窗體。也許我可以使用afterShowForm
事件來更改editoptions?有人做過這樣的事嗎?
只想說感謝 - 我有完全相同的要求ents,我無法弄清楚如何調用beforeShowForm函數。這正是我所需要的 - 再次感謝。 – 2010-03-06 22:44:27
同上。感謝您的發表。這節省了我相當多的時間。 – 2010-05-16 19:58:18