jQWidgets Forums

jQuery UI Widgets Forums Grid Datagrid refresh Question

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 12 years, 7 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Datagrid refresh Question #11114

    DavidSimmons
    Participant

    I am doing cell editing which updates many column values based on one cell update. My problem when my cell update ajax is success I need to update all data to show the columns that were updated at the same time. I was trying the following on my ajax success and I see the data load icon, but the other data is not refreshing. If I refresh the page all data is correct. Is there a better way to do this?

    source.url = ‘TargetMarkupData.php’,
    $(“#jqxgrid”).jqxGrid(‘updatebounddata’);

    $(“#jqxgrid”).bind(‘cellvaluechanged’, function (event) {
    var rowid = args.rowindex;
    var column = args.datafield;
    var value = args.newvalue;
    var oldvalue = args.oldvalue;
    var data = new Object();

    var id = $(‘#jqxgrid’).jqxGrid(‘getcellvalue’, rowid, “ID”);

    data.update=’true&’;
    data.id=id;
    data.column=column;
    data.value=value;

    if(value !== oldvalue ){
    $.ajax({
    dataType: ‘json’,
    url: ‘TargetMarkupData.php’,
    cache: false,
    data: data,
    success: function (data, status, xhr) {
    $(“#message”).html(“Transaction: ” + xhr.responseText);
    commit(true);
    ************ Update the grid data completely ************

    },
    error: function (jqXHR, textStatus, errorThrown) {
    $(“#message”).html(“Transaction: ” + jqXHR.responseText);
    commit(false);
    }
    });
    }
    });

    Datagrid refresh Question #11127

    Peter Stoev
    Keymaster

    Hi David,

    To refresh the Grid’s data, call the updatebounddata method. It makes a call to the server and refreshes the Grid’s data. To change the Grid’s data source, set its source property to a new instance of jqxDataAdapter. You can also examine our ‘Refresh Data’ sample available online, which illustrates how to dynamically update the Grid’s data. However, I don’t think that cellvaluechanged should be used for synchronization with the server. This should be done in the updaterow, deleterow or addrow callback functions of the source object.

    Best Regards,
    Peter Stoev

    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.