Forum

July 12th, 2025
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
adding custom parameters to the grid
27/11/2009
09:05
Avatar
grunch
Maracay, Venezuela
Member
Members
Forum Posts: 3
Member Since:
27/11/2009
sp_UserOfflineSmall Offline

Im having a problem with the jqgrid, im using custom buttons with "navButtonAdd" method and i need to send an "oper" parameter, but i dont know how do that

can you tell me how i can add custom parameters to send with the grid? 

thanks in advance

30/11/2009
12:41
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

There are a lot of solutions, but the problem is where you want to add the parameter - to the grid url or to the editurl options?

In first case you can use setGridParam and use postData array

In second case you can use editData array if you use form editing,

but as I again say - with so little information not possible to help.

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.

30/11/2009
21:54
Avatar
grunch
Maracay, Venezuela
Member
Members
Forum Posts: 3
Member Since:
27/11/2009
sp_UserOfflineSmall Offline

Hi Tony, thanks for answer, i explain much better what im trying to do

i have three tables and two grids

table "ficha"

id: auto_incremental

...

table "persona"

id: auto_incremental

name: string

...

table "persona_ficha"

id: auto_incremental

ficha_id: fk with main

persona_id: fk with people

status: char(1) 

My first grid is where i CRUD my "persona" table, this grid works all right, when i make double clic in the persona grid i fill the second grid, this is a grid where i put some fields from the persona table, i change the status (a combo select) for that persona record and i need to save the record in the table called "persona_ficha"

Now the problem is work with the second grid, i have this:

onSelectRow: function(id) {

if(id != null) {

   jQuery("#grid_persona_ficha").editRow(id);

}

}

this is fine, when i select the row i can edit the grid, but i don't know how to save this, i would like to send the data with an "enter" press event by example, but i can't find this option in the event section in the wiki, the other way im trying to make it work is adding a custom save button in the navigation bar to save all the rows with a for loop

i did this:

  .navButtonAdd('#pager_persona_ficha',{

   title:"Guardar todos los registros", 

   caption:"",

   buttonicon:"ui-icon-circle-plus", 

   onClickButton: function(){ 

      var x = jQuery("#grid_persona_ficha").getDataIDs();

      for(var i=0; i<x.length;i++)

      {

        jQuery("#grid_persona_ficha").saveRow(x[i]);

      }

   }, 

   position:"first"

  });

but the problem in two cases is when i send the row data as a post i don't have a parameter like "oper" which i need to send values like "add", "edit" and "del"

concluding what i need to know is how to capture and [Enter] key pressed to send the information and how to send a parameter "oper" which this value change depending the buttons in the navbar you pressed
Thanks in advance

02/12/2009
10:05
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Maybe you do not read the right section in the docs.

If you pass a second parameter to editRow - e.g true you can save tha data with enter key

See here:

http://www.trirand.com/jqgridw.....ng#editrow

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.

12/12/2009
00:31
Avatar
grunch
Maracay, Venezuela
Member
Members
Forum Posts: 3
Member Since:
27/11/2009
sp_UserOfflineSmall Offline

Hi 

Thanks you were right, your answer helps me a lot, but i still have a doubt, how i can send another variable when the enter is pressed, what i need to send is a variable like "oper" what i can use to edit, add or delete the record.

Thanks in advance

13/12/2009
17:51
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

In the same link you will see  extraparam option use it to pass additional parameters.

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.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 994

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