jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Cell editing in jqxgrid using asp.net and sql database
This topic contains 3 replies, has 3 voices, and was last updated by UJanke 12 years, 4 months ago.
-
Author
-
Kindly help me how to edit a cell of jqxgrid in asp.net web form and updating the changes in sql database.
If there is any documentation related to this, please tell.
Hello parul,
Please check out the documentation entry Cell editing with jqxGrid and ASP.NET MVC3 and the other entries on ASP .NET Integration in the documentation. We hope they are helpful to you.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Hello,
I have seen that documentation and added the updaterow function in my aspx page. Also I am able to get the data of the edited row but how to pass the data in the web method as the method is not being called.
Below is the code which is there in the documentation:
$.ajax({
dataType: ‘json’,
url: ‘Employees/UpdateEmployee’,
data: data,
success: function (data, status, xhr) {
// update command is executed.
}
});I have created web method and passing the method name in url field but tell me how to check whether the data is being sent to the aspx.vb page through the above code… I want this functionality in aspx page not in asp.net MVC3.
Kindly suggest.
First i guess it should be url: ‘Employees.aspx/UpdateEmployee. Also you should not use data. No clue what data is in youre case.
A sample call:
$.ajax({ type: "POST", url: "HaizUI.aspx/WriteHT", contentType: "application/json;charset=utf-8", data: "{ID:" + rowdata.FrontEnd_HA_DealUTHTID + ",DealNumber:'" + rowdata.DealNumber + "'" + ",RealVirtual:'" + rowdata.RealVirtual + "'" + ",PercentagesOfHedge:'" + rowdata.PercentagesOfHedge + "'" + ",MVCleanDesignation:'" + rowdata.MVCleanDesignation + "'" + ",MVCleanDedesignation:'" + rowdata.MVCleanDedesignation + "'" + ",AccrualsInception_HT:'" + rowdata.AccrualsInception_HT + "'" + ",AccrualsDedesignation_HT:'" + rowdata.AccrualsDedesignation_HT + "'" + "}", dataType: "json", success: function(data) { var p = data.d; $("#htgrid").jqxGrid('updatebounddata'); commit(true); }, error: function(request, status, error) { ajaxError(request, status, error); commit(false); } })
rowdata.xxx are vars . ajaxError is a global error function:
function ajaxError(request, type, errorThrown) { var message = "There was an error with the AJAX request.\n"; switch (type) { case 'timeout': message += "The request timed out."; break; case 'notmodified': message += "The request was not modified but was not retrieved from the cache."; break; case 'parseerror': message += "XML/Json format is bad."; break; default: message += "HTTP Error (" + request.status + " " + request.statusText + ")."; } message += "\n"; alert(message);}
Also you should google for the script
JScriptWebmethod.js and json2.js ( you will be need both)
which make things a bit more ez.
Greetings
Uwe -
AuthorPosts
You must be logged in to reply to this topic.