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
jgGrid customized add new form
09/12/2011
18:38
Avatar
wolfatwork
New Member
Members
Forum Posts: 1
Member Since:
09/12/2011
sp_UserOfflineSmall Offline

Please help!! I am newbie on jggrid, loved it. However, there is a challenge. When I open a blank form to add new row to the grid, I need some fields on the form to be dynamically updated by going to the database to search for data if I change a field on the form. I found the code in the javascript to create a form for adding new row, may I change it to read from an external file (like an asp, php page) or is there any way to do it properly??

12/12/2011
16:48
Avatar
yellowduckbear
Member
Members
Forum Posts: 4
Member Since:
19/08/2011
sp_UserOfflineSmall Offline

Try the recreateForm and beforeShowForm in pager add section ...

recreateForm: true,

beforeShowForm: function(form){

$("#field0 from colModel", form).attr('value', '3');

$("#field1 from colModel", form).attr('hidden', 'true');

...

etc

},

KiT

31/12/2011
08:27
Avatar
jigneshmistry
Surat, Gujarat,India
Member
Members
Forum Posts: 7
Member Since:
26/12/2011
sp_UserOfflineSmall Offline

Hi 

I am having problem in 

beforeShowForm: function(form){

alert('before show form');

},

I have try this but  it will not give me any msg . Can you please help me.

thanks.

03/01/2012
18:00
Avatar
nelsonm
Michigan, USA
Member
Members
Forum Posts: 106
Member Since:
20/08/2011
sp_UserOfflineSmall Offline

beforeShowForm: function(form){alert('before show form');},

The function syntax is correct and should work.  You may have it in the wrong area.  It should go into the navGrid section.

$('#tab3-grid').jqGrid('navGrid', '#tab3-pager',
   {view:true, closeOnEscape:true}, // general parameters.
   {jqModal:true, beforeShowForm: function(f){alert('hello');}}, // edit options.
   {jqModal:true, beforeShowForm: dosomething}, // add options.
   {jqModal:true, afterSubmit: serverMessage}, // del options.
   {jqModal:true}, // search options.
   {jqModal:true} // view options.
    );

    var dosomething = function(formid){
       // stuff to do.
    }

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
51 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