Forum


12:27

Hi,
I using the latest JQGrid (3.5.3) and I need to disable a select list (dropdown) in my edit form during edit operations. Reason being is that the field to be disabled is part of the primary key and should not be changed during edit. The same field should be 'selectable' during add operations. The code below make my select list disabled however the form will not display on the first click of the edit icon on the nav bar. Strangely - it does come up on the next click of the edit icon and the dropdown is disabled as it should be. Is this a bug? Or is there a better way to achieve what I want. Thanks.
beforeShowForm: function(eparams) {
document.getElementById('equip_id').disabled = true;
document.getElementById('service_dt').disabled = true;
document.getElementById('serv_descr').disabled = true;
document.getElementById('calc_next_svc').checked = 'true';
}
This is in my edit options array of the navGrid method. The dropdown is 'serv_descr'. The other 2 are text fields and do not cause this issue. Only the select list disabling causes the problem.
17:15

22/12/2008

First try in afterShowForm(form) event, then you can use jquery selector something like:
$('#serv_descr',form).attr('disabled','disabled');
I am curious to know why you would get all data from the server to populate your DDL then disable it. If ypu don't want this field be editable in colModel select it as editalbe:false, and it won't be shown in the form.
16:41

Moderators
30/10/2007

Hello,
There are so many post about this here (including jquery google groups)
Also basically you will need to use beforeShowForm in add and edit.
In add make the control readonly or hide them in edit enable it or show them
Best Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
19:12

This is probably the wrong place for my original post. For more details, please see: Forums [Image Can Not Be Found] Bugs [Image Can Not Be Found] Disabled dynamic combo doesn’t work for first time edit mode.
Thanks,
Brian
11:42

Moderators
30/10/2007

Hello,
Alredy answered on the same post
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
48 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