Forum


09:34

08/09/2008

You can use the beforeSubmit event to do that. For example:
beforeSubmit: function() {
var sr = jQuery("#list").getGridParam('selrow');
var rowData = jQuery("#list").getRowData(sr);
this.editData = {"NU_RIF_EMPRESA" : rowData['NU_RIF_EMPRESA']};
retarr = {"NU_RIF_EMPRESA" : rowData['NU_RIF_EMPRESA']};
return retarr;
}
Here I take the field NU:RIF_Empresa and add it to my QueryString data..
HTH
03:07

Moderators
30/10/2007

Hello,
I think there must be better explanation of your problem
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.
09:08

05/02/2009

I have a JQGrid that produces a table with eight columns (not including the one reserved for the plus/minus signs). When I click the plus sign, I would like to pass the contents of the selected row's first column as a parameter to the server-side program.
For instance, if the first column is "Customer Number," and I click the plus sign on the row that has a customer number of "0001," then, I would like for the program call to appear something like "svrpgm?custNum=0001".
09:25

Moderators
30/10/2007

Hello,
Since you use the subGridRowExpanded as of documentation:
This event is raised when the subgrid is enabled and is executed when the user clicks on the plus icon of the grid. Can be used to put custom data in the subgrid.
- pID is the unique id of the div element where we can put contents when subgrid is enabled,
- id is the id of the row
If you have the id then you can $("#mygrid").getRowData( id ) - this retun all the values from the current clicked row and before constructing the grid you can pass what you want from this array
Regards
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.
10:07

05/02/2009

Okay. I got the JQGrid to assign an id to the row that's equivalent to the data in fhe first column of each row. I have the returned JSON string in the correct format. However, I'm unsure as to what kind of variables I need to pass in the beginning. For instance, right now, I have
{"rows":[{"divisionNumber":..........}]}
Do I need to specify more things than just "rows"? Because although the JSON string is correct, the subgrid is not being populated.
07:27

Moderators
30/10/2007

Hello,
Why do not see the examples in the docs? They speak quite.
One possible solution (from demo site):
{"rows":[{"id":"1","cell":["1","item 1","2.00","100.00","200.00"]},{"id":"2","cell":["2","item 2","3
.00","50.00","150.00"]},{"id":"3","cell":["3","item 3","1.00","50.00","50.00"]},{"id":"4","cell":["4"
,"item 4","1.00","200.00","200.00"]}]}
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.
09:02

05/02/2009

Hi. I'm not sure that you understood my question. I have tried the exact format of the string you suggested from the demo site. However, it still doesn't work when applying it to the subgrid. So, it appears to me as though either I need to include more parameters like “rows” or something is wrong with my JQuery code which is as follows:
subGrid: true,
subGridRowExpanded: function(subgrid_id, row_id)
{
var subgrid_table_id;
subgrid_table_id = subgrid_id+”_t”;
jQuery(”#”+subgrid_id).html(”<table id='”+subgrid_table_id+”'
class='scroll'></table>”);
jQuery(”#”+subgrid_table_id).jqGrid(
{
url:”inv0003?id=”+row_id,
datatype: “json”,
//mtype: GET,
colNames: ['Division<br />Number','Name','On Hand<br />Weight','% of<br />Total','Per Lb<br />Cost','Avg Monthly<br />Sales','Months<br />Supply','Turnover<br />Rate'],
colModel:
[
{name:"divisionNumber",index:"divNum",width:80,key:true},
{name:"divisionName",index:"divName",width:130},
{name:"onHandWeight",index:"ohWeight",width:80,align:"right"},
{name:"percentOfTotal",index:"pctOfTotal",width:80,align:"right"},
{name:"perLbCost",index:"perLbCost",width:100,align:"right",sortable:false},
{name:"avgMonthlyWeight",index:"avgMonthlySales",width:80,align:"right",sortable:true},
{name:"monthsSupply",index:"monthsSupply",width:80,align:"right",sortable:true},
{name:"turnoverRate",index:"turnRate",width:80,align:"center",sortable:true},
],
height: 100,
rowNum:20,
imgpath: “../javascript/JQGrid/themes/green/images”,
sortname: 'divisionNumber',
sortorder: “asc”
});
},
09:17

Moderators
30/10/2007

Hello,
In your case grid as subgrid - the subgrid is simple grid - so the json format should be the same as those of the main grid.
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.
Most Users Ever Online: 715
Currently Online:
43 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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66