Hello,
You can use beforeShowForm event and set it one for edit and another
for add.
In case of add you can :

beforeShowForm : function(formid) {
   jQuery("#UserName", formid).removeAttr("readonly");
}

in the edit
beforeShowForm : function(formid) {
   jQuery("#UserName",formid).attr("readonly",true);
}

Regards
Tony


On Jul 27, 4:33 pm, Ravi Mori <morir...@gmail.com> wrote:
> Hi..
>  i have some doubts in usage of jqgrid. I am trying to achieve fallowing
> functionality.
>
> I have insert and edit functionality in same form. Now i have one field
> called "UserName", which i don't want to edit. so for that i make it
> readonly as following:
>
> { name: 'UserName', index: 'UserName', width: 100, align: 'center', hidden:
> false, editable: true, editoptions: { size: 40, readonly: true} },
> But this creates problem at insertion time..i can't insert any data in
> UserName at the time of inserting new record because its a readonly..
>
> Any suggessions??

Reply via email to