Author Topic: Refresh Row after Changing Data Model  (Read 2167 times)

fmusignac

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 11
    • View Profile
Refresh Row after Changing Data Model
« on: April 06, 2018, 06:12:38 pm »
I am having an issue using the refreshRow method after changing the pq_hidden property for a row. I am getting the error "Uncaught too many iterations" regardless of how I am using the refresh method whether in a loop looking for every qualifying row or with just one row by specifying the index (commented out below). I am trying not to use the refreshDataAndView method since I have checkbox controls in the grid that loose the clicked state when I refresh the whole thing. Please advise. Thanks!

    var detailsGrid = $('div#BudgetDetails').pqGrid()
    var data = detailsGrid.pqGrid("option", "dataModel").data;

    for (var i = 0, len = data.length; i < len; i++) {
        if (data[0].indexOf('rateCell') != -1) {
            data.pq_hidden = !visible;
            $("div#BudgetDetails").pqGrid("refreshRow", { rowIndx: i });
        }
    }
    //detailsGrid.pqGrid("refreshDataAndView");
    //pq.grid("div#BudgetDetails").refreshRow({ rowIndx: 4 });

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6299
    • View Profile
Re: Refresh Row after Changing Data Model
« Reply #1 on: April 06, 2018, 06:34:43 pm »
There is no need to use refreshDataAndView, understandably it also refreshes the data which is not desired.

refresh or refreshView would be sufficient.