Forum


We found that while saving an edited cell in JQGrid, there is an HTTP POST request which returns the whole page as Response. For improving the performance of our application in low bandwidth (256 kb), we need to avoid this.
Now the code for updating data source is
File :- jqgrid.min.js
saveCell: function (d, e) {
.........
a.ajax(a.extend({ url: b.p.cellurl,
data: a.isFunction(b.p.serializeCellData) ? b.p.serializeCellData.call(b, q) : q,
type: "POST",
async: true,
complete: function (f, i) {...
...........
})
}
The url contains the value : /sample.aspx?jqGridID=jqgSample&editMode=1
File :- sample.aspx.cs
protected void Page_Load(object sender, EventArgs e) { if (Page.Request.QueryString["jqGridID"] != null)
{
if (jqgSample.AjaxCallBackMode == AjaxCallBackMode.RequestData)
{
jqgSample.DataSource = DataSource;
jqgSample.DataBind();
}
}
}
protected void jqgSample_RowEditing(object sender, Trirand.Web.UI.WebControls.JQGridRowEditEventArgs e) {
//code for updating data source
}
During our research, we found a method to update the data source of Grid with edited value using HTTP GET request, instead of using HTTP Post and JQGridRowEditEvent. The changes are made in the highlighted portion.
File :- jqgrid.min.js
saveCell: function (d, e) {
.........
a.ajax(a.extend({ url: b.p.url,
data: a.isFunction(b.p.serializeCellData) ? b.p.serializeCellData.call(b, q) : q,
type: "GET",
async: true,
complete: function (f, i) {...
...........
})
}
The url contains the value : /sample.aspx?jqGridID=jqgSample
File :- sample.aspx.cs
protected void Page_Load(object sender, EventArgs e) { if (Page.Request.QueryString["jqGridID"] != null)
{
if (jqgSample.AjaxCallBackMode == AjaxCallBackMode.RequestData)
{
if (Page.Request.QueryString["oper"] == "edit") { JQGridRowEditEventArgs eventArg = new JQGridRowEditEventArgs(); eventArg.RowData = Page.Request.QueryString; jqgSample_RowEditing(jqgSample, eventArg); }
jqgSample.DataSource = DataSource;
jqgSample.DataBind();
}
}
}
protected void jqgSample_RowEditing(object sender,Trirand.Web.UI.WebControls.JQGridRowEditEventArgs e)
{
//code for updating data source
}
Our research result will update the data source of the Grid when the Request QueryString contains the value “edit” for the key “oper”.
Is there is any issue using this method ?
Is there any other method to avoid the POST of the whole page while saving an edited cell ?
Waiting for a favorable response from you.
Info: we are using Version: jqSuiteASPNET_4_4_1_0
Thanks in advance
Most Users Ever Online: 715
Currently Online:
42 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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66