Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Disable edit form select list
09/10/2009
12:27
Avatar
Mike27516
Guest
Guests

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.

09/10/2009
13:40
Avatar
Mike27516
Guest
Guests

Also - when the form does come up on the second click - it is essntially broken - meaning submit or cancel buttons do nothing. Strange - this is caused by disabling the dropdown in the fashion described above. Any alternatives please reply. Thanks.

10/10/2009
17:15
Avatar
MamaliFrenchi
Member
Members
Forum Posts: 62
Member Since:
22/12/2008
sp_UserOfflineSmall Offline

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.

28/12/2009
22:19
Avatar
cheetos
Guest
Guests

Mike,

i have a similar requirement, where some fields in the form are not editable but should be displayed on the form. but while adding i need these to be editable.

Please let me know if you any of you all found a soultion?Confused

29/12/2009
16:41
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

18/01/2010
19:12
Avatar
Brian
Guest
Guests

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

19/01/2010
11:42
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information