Author Topic: Progress Bar during updateRow Loop  (Read 2985 times)

mshapiro

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 35
    • View Profile
Progress Bar during updateRow Loop
« on: July 01, 2015, 04:53:06 am »
I have a grid that gets updated after the user initiates a calculation function.  This currently takes 30 seconds or more if there are 150+ rows.  trackModel is on.

The slow part of the update is after the calculations when the updated column values are displayed. This is done with a loop over all the rows using updateRow to update those rows with changed values in 2 columns:

                $gridEmployees.pqGrid("updateRow", {
                      rowIndx: ratingCalculations.rownum, row: {
                      'PeerGroupRank': ratingCalculations.Rank,
                      'PeerGroupQuartile': ratingCalculations.Quartile
                      }, checkEditable: false
                  });

I have a progress bar to display during  the whole process

    <div id="calcprogress" class="progress progress-striped active" style="display: none;">
        <div class=" progress-bar" role="progressbar" style="width:100%;">Calculating...</div>
    </div>

I can't get $("#calcprogress").show(); to work while the grid is being updated with updateRow.  Nothing is displayed.  Is there a way around this? 

Would refreshing dataModel.data work with trackModel on?.  There are 20 columns in the grid, only 2 are being updated and other columns might have changes that haven't been committed?  If I could do that then there is no need for a progress bar.  Thanks.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: Progress Bar during updateRow Loop
« Reply #1 on: July 01, 2015, 05:21:49 pm »
1. Faster way of updating lot of rows without losing tracking.

Pass refresh: false as one of the arguments to updateRow() and call refresh() at the end of loop.


2. Slower way along with progress bar.

call updateRow with a timer window.setInterval.

mshapiro

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 35
    • View Profile
Re: Progress Bar during updateRow Loop
« Reply #2 on: July 02, 2015, 05:22:41 am »
"refresh: false" as an argument to updateRow() solves the issue.  The process is now fast enough that a progress bar is not needed. 

I don't see "refresh: false" on the API page as a documented argument to updateRow().  Is this implied?  How can I find other arguments that are available to the various methods that are not specifically listed on the API page?  Thanks.