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
How to change the recreateForm
08/09/2010
19:51
Avatar
stephen
Member
Members
Forum Posts: 9
Member Since:
06/09/2010
sp_UserOfflineSmall Offline

As we know we can define the recreatFrom like this:

jQuery("grid").jqGrid({

   ...

   edit:{..., recreateFrom:true,...}

   ...

})

In some case, I want to change the recreateFrom. I tried the following ways to change it, but failed:

1) jQuery("#grid").jqGrid("setGridParam",{recreateForm: true}).

2) jQuery("#grid").jqGrid("editGridRow", "new", {recreateForm: true})

Anybody who knows is there any other way to change this value? 

Thanks,

Stephen

09/09/2010
00:19
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hi Stephen!

I would you set recreateForm: true as you the general default setting. See http://stackoverflow.com/quest.....nbsp;which describe a problem which can be.

So you can do following

jQuery.extend(jQuery.jgrid.edit, {recreateForm: true});

The usage of

jQuery("#grid_id").jqGrid('editGridRow', rowid, properties);

would be also correct if you implement for example inline edit mode and call editGridRow manually inside of onSelectRow or  ondblClickRow enevt handler. If you use form editing then you call editGridRow method not direct. To be able to forward the value recreateForm:true to editGridRow you should do this as a part of `navGrid` call inside of prmEdit, prmAdd parameters:

jqGrid('navGrid', '#pager',
                         { edit: true, add: true, del: false, search: true },
                         { recreateForm: true }, // use default settings for edit
                         { recreateForm: true }, // use default settings for add
                         {}, // delete instead that del:false we need this
                         {multipleSearch : true}); // enable the advanced searching 

To make all more simple I suggest just set 

jQuery.extend(jQuery.jgrid.edit, {recreateForm: true});

at the beginning and forget about existing of this parameter.

Best regards
Oleg 

09/09/2010
06:02
Avatar
stephen
Member
Members
Forum Posts: 9
Member Since:
06/09/2010
sp_UserOfflineSmall Offline

Oleg, thank you so much.

You mean if I use form editing and I don't extend the default setting, I have to define "recreateFrom:true" as a part of "navGrid" call inside of preEdit, preAdd parameters. This is the only way to set "recreateFrom:true". I can't change it later?

How about the other properties and functions, for example:"topinfo", "bottominfo","closeAfterAdd","reloadAfterSubmit". Can they be changed?

If I extend the default setting of jQuery.jgrid.edit, it means all the subsequent grid use it. Is there any performance problem?

Thanks,

Stephen

11/09/2010
22:35
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hello Stephen,

Default parameter of the function editGridRow are documented unter http://www.trirand.com/jqgridw.....ditgridrow. You can change the default values using

jQuery.extend(jQuery.jgrid.edit, {/* new default values */});

Default values of any parameters of editGridRow including all you listed can you change in the way.

If use use a parameter of editGridRow directly in the call of the function editGridRow or indirect as parameter of navGrid then will be used the parameters and not default values. So all is very easy.

I use for examples in all jqGrids which I use in inline or form editing recreateForm: true. So I included ovewriting default parameters in one JavaScript file which I load in all my pages (in my master page). It maks the code which I write for every grid shorter.

I see no performance problems with the usage of default parameters.

Regards
Oleg

15/09/2010
19:26
Avatar
stephen
Member
Members
Forum Posts: 9
Member Since:
06/09/2010
sp_UserOfflineSmall Offline

Thanks, Oleg

I will try to extend the default setting.

Thank you so much.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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