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
Add and Edit form editing issue
27/08/2009
04:36
Avatar
larole
Guest
Guests

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'} },

27/08/2009
07:07
Avatar
Renso
PA
Member
Members
Forum Posts: 118
Member Since:
11/09/2008
sp_UserOfflineSmall Offline

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();

27/08/2009
09:50
Avatar
larole
Guest
Guests

Thx m8, that was very helpful.

Forum Timezone: Europe/Sofia

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

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

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information