Forum


04:36

Hi,
Im just started using jqgrid and its great but i can't find out how i can make a field editable in add form dialog and not in edit dialog. It seems that when changing edit dialog it also effects the add dialog. How can i make a field visible and editable in add dialog and not visible/editable in edit dialog?
For example i want this field to behave like that:
{ name: 'Password', index: 'Password', hidden: true, edittype: 'password', editable: true, editoptions: { size: 25 }, formoptions: { elmsuffix: '(*)' }, editrules: { edithidden:'true', required: 'true'} },
You cannot specify or override the colModel properties during navigation (i.e. navGrid). You need to attack it during the beforeShowForm event:
.navGrid(item + 'Pager',
{ refresh: true, edit: true, add: true, del: true, search: false }, //options
{height: 280, width: 500,
reloadAfterSubmit: true,
modal: true,
processData: 'Updating the data...',
editCaption: 'Edit data,
beforeShowForm: function(form) {
$('#Password.FormElement').hide();
}
}, // edit options
{height: 280, width: 500,
reloadAfterSubmit: true,
modal: true,
processData: 'Adding the new data...',
addCaption: 'Add new data',
beforeShowForm: function(form) {
$('#Password.FormElement').show();
}
}, // add options
Added ".FormElement" class in case you have another field on your screen with the same id, less chance of a selector clash. Of course you can ommit it or search within the form window also: form.find('#FirstName').hide();
Most Users Ever Online: 715
Currently Online:
58 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66