Please can you give me more details, I'm a novice in web techs, is it like what Tony said on his first post for ajax:
onSelectRow : function (id) {
Yes, at all cases on the link only show “localhost/website/Default5.aspx” and I do not know how
the paramters for the grid are passed and retrieved by Response.QueryString like select, row, sord, sidx
of what the jqgrid needs to make response back of Json data format for the grid while adding id
and que parameters are not detected.
12seconds said:
Hi,
Is your javascript doing a post back when you select a field on the jqgrid? So the link will be something similar:
localhost:port/Default.aspx?cmd=select&que=0&id=123Where 123 is the ID selected in the jqgrid.
If you talk about the url address on the webpage of the browser on top. No. It shows only the
name of the page “like localhost/website/Default5.aspx”, I feel that JqGrid does not refresh
entire page, I have setup Firbug (A utility shows what actually posted by the script to the
page) When I first load the grid I get on the param section the following:
http://localhost/webpage/Default5.aspx?cmd=select&que=1&_search=false&nd=
1379651648678&rows=10&page=1&sidx=id&sord=asc' (This does not show on the
browser URL as I stated)
and paramtered shown that suppose to be posted:
_search false
cmd select
nd 1379651648678
page 1
que 1
rows 10
sidx id
sord asc
While if I click on a field on the grid data (Say row with id 17) I get the following paramters shown:
cmd select
id 17
page 1
que 1
rows 10
search false
sidx id
sord asc
If that link is displaying and working correctly then you can use querystring on your pageload:
if(!IsPostBack)
tony Hello,
Following your suggestion:
onSelectRow: function (id) {
//var treedata = $("#htmlTable5").jqGrid('getRowData', id);
var selr = jQuery('#htmlTable5').jqGrid('getGridParam', 'selrow');
//var value = $('#htmlTable5').jqGrid('getCell', sel_id, '_id');
//alert('Selected row ID ' + id);
id = selr;
$("#htmlTable5").jqGrid('setGridParam', {postData: {id:id}, mtype: 'POST'});
$.ajax({
url: 'GetData.aspx?cmd=select&que=1&search=false&rows=10&page=1&sidx=id&sord=asc&id=' + id,
success : function(response) {
Thank you Tony for the msg. Here I rewrite what the issue is: When I click to select a row on the jqgrid it does
not send the selected row id field. In other word, for some reason that I cannot retrieve the id on the backend
C# code of the page that displays the grid.
Using Resquest.QueryString[“id”] / Resquest.QueryString[“que”] per my posted code above is always null, tried
to use post/get methods and still I cannot retrieve the id of selected row, even though I could see the grid
respond to my selection by showing the selected row id on the Caption of the grid, in addition that I could
trace using firebug utility that a response with parameters showing
que=1 and id=x.
Some info about the grid: the grid uses above JS code on the header of Default.aspx page
and Resquest.QueryString[“id”] / Resquest.QueryString[“que”] is used in the Page_Load section code of
same page (Default.aspx.cs).
I do not know why cmd=select would work to display the grid content but nothing else of other parameters,
how to pass a parameter
from the grid then to the page to be used like showing a picture of the selected row on the grid??
Is there a filter on the grid??? Is it suppose to be editurl to direct the response to a different page???
But why select parameter would work?? I'm really confused and tired of this issue. I appreciate any
hint or guide.
By the way why when posting on this forum the text are cliped from the most right side?
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top