jQWidgets Forums

Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts

  • markm123
    Participant

    Actually, upon further testing … setcellvalue is re-invoking the updaterow function (a variable would have to passed/updated to tell it not to update)


    markm123
    Participant

    Yes, commit(true) is being called but I still cannot get the local-row to update with fresh data from the server without it making a second call…

    The only solution I can possibly see is:

    
    					commit(true);
    					
    					$.each(data.content, function(k, v) {
    						if ($('#'+ref).jqxGrid('iscolumnvisible', k)) {
    							$('#'+ref).jqxGrid('setcellvalue', rowindex, k, v);
    						}
    					});
    

    Are you sure that the commit(..) function within the updaterow function supports updating the local row with JSON supplied in 2nd parameter if present?

    Example:
    updaterow: function (rowid, rowdata, commit) {
    var newdata = {full_name: “abc”};
    commit(true, newdata);
    }

    And as a result, the column in that local row would be updated with “abc” regardless with what rowdata contains..


    markm123
    Participant

    Correction: I know commit(false) works because the client-side row is reverted back to previous changes upon updaterow when that statement is present. I don’t know that commit(true) is being called as nothing on the client-side indicates it (Given the fact that the local row is not updating from server-side data after updaterow)

    I am receiving no errors however…


    markm123
    Participant

    Yes because without the commit, nothing happends on the client-side… I tried:

    if (data.success==true) {
    commit(true);
    $(‘#’+ref).jqxGrid(‘updatebounddata’, data.content);
    }

    data JSON response below (contains all rows as required per updateboundata):
    {“success”:true,”content”:[{“id”:”96″,”name”:””,”annual_income”:”8787.00″,”job_title”:””,”stated_credit_score”:”9976″,”experian_credit_score”:null,”equifax_credit_score”:null,”transunion_credit_score”:null,”credit_report_source”:””,”is_cosigner”:”0″,”lastUpdated”:null},{“id”:”97″,”name”:””,”annual_income”:”88.00″,”job_title”:””,”stated_credit_score”:””,”experian_credit_score”:null,”equifax_credit_score”:null,”transunion_credit_score”:null,”credit_report_source”:””,”is_cosigner”:”1″,”lastUpdated”:null}]}

    However another call is being made to the server to get updated data …

    Is there anyway to update the local data from the JSON response given after an update?

    I should also note that the rowid is my databases unique ID (I have it specified in the data source id: ‘id’,).

    Perhaps commit needs some other type of rowid or does it know that the ID I am referring to is the one my server assigned it…

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