I am developing a web application using JSP & Servlet (IDE: Eclipse, Database: Oracle10). I am using jqGrid to display records in tabular format.
I want to set combobox
readonly in Edit
dialog.
colNames & colModel
colNames:['User Name', 'Seq No.'],
colModel:[
{name:'USER_ID',index:'USER_ID', width:200,sortable:true,editable:true,edittype:"select", editoptions: {maxlength: 20,dataUrl: 'ServletName?action=comboUserID'}},
{name:'SEQUENCE_NUMBER',index:'SEQUENCE_NUMBER', width:50,sortable:true, editable:true, editrules: { required: true, number:true},editoptions: {size:4,maxlength: 2}}
],
pager code
).navGrid('#pager10_d1',{cloneToTop:true,edit:true,add:true,del:true,view:true,search: true},
{
width:350,
modal:true,
jqModal: false,
savekey: [true,13],
closeOnEscape:true,
mtype:'POST',
closeOnSubmit: true,
recreateForm: true,
editurl:'MyServletName',
editData:
{
action: 'userRolesUPDATE',
userID: function () {return userID;}
},
beforeShowForm: function(form)
{
$('#USER_ID',form).attr('readonly','readonly');
}
}
//add dialog and other dialog code here
);
I am refering to this answer by Oleg , but on my form it is not working, combobox is still editable. The Same code works for other Field
in the grid, but it is not working for combobox
.
So let me know if there is any mistake in my code.