jQuery UI Widgets Forums DataTable updateRow doesn't working

This topic contains 1 reply, has 2 voices, and was last updated by  Dimitar 8 years, 7 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • updateRow doesn't working #75779

    xnfzy
    Participant

    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);
    }
    ******************************

    updateRow doesn't working #75790

    Dimitar
    Participant

    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,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.