jQWidgets Forums
jQuery UI Widgets › Forums › DataTable › updateRow doesn't working
Tagged: Angular Data Table, callback, datatable, jquery data table, jqxdatatable, server-side, update row, updaterow
This topic contains 1 reply, has 2 voices, and was last updated by Dimitar 9 years, 6 months ago.
-
Author
-
Hi, Everybody
In my DataTable e.g, updateRow can’t working,pls help me!!!
*cshtml code***********
Update Code:
updateRow: function (rowID, rowData, commit) {
$.ajax({
type:’POST’,
dataType: ‘json’,
cache: false,
async: false,
url: ‘/Employee/UpdateData’,
data: rowData,
success: function (data, status, xhr) {
// update command is executed.
commit(true);
},
error: function (xhr, textStatus, errorThrown) {
alert(errorThrown);
}
});*************
$(“#save”).mousedown(function () {
// close jqxWindow.
$(“#dialog”).jqxWindow(‘close’);
// update edited row.
var editRow = parseInt($(“#dialog”).attr(‘data-row’));
var rowData = {
OrderID: $(“#orderID”).val(),
Freight: $(“#freight”).val(),
ShipCountry: $(“#shipCountry”).val(),
ShippedDate: $(“#shipDate”).val()
};
$(“#dataTable”).jqxDataTable(‘updateRow’, editRow, rowData);
});
**EmployeeController code ****************************************************
public ActionResult UpdateData(Employee employee)
{
EmployeeEntity empEty = new EmployeeEntity();
empEty.Update(employee);
return Json(empEty, JsonRequestBehavior.AllowGet);
}
*EmployeeEntity code**********************
public void Update(Employee employeemod)
{
Parameter[] parameter ={
new Parameter(“@orderID”,SqlDbType.NVarChar,-1,employeemod.FirstName),
new Parameter(“@freight”,SqlDbType.Decimal,-1,employeemod.Freight),
new Parameter(“@country”,SqlDbType.NVarChar,-1,employeemod.Country)
};
objBase.ExecuteProcedure(“sp_Employee_update”, parameter);
}
******************************Hi xnfzy,
Your client-side code looks fine. Are there any errors thrown in your browser’s console? If not, the issue probably originates on your server side, but we cannot assist you with it, unfortunately. You may take a look at a sample implementation of this callback and the respective server-side code in the tutorial CRUD with jqxGrid, ASP.NET MVC3 and SQL.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.