ParamQuery grid support forum

General Category => ParamQuery Pro Evaluation Support => Topic started by: billybraga on May 12, 2016, 11:56:20 pm

Title: Refresh summarydata cell
Post by: billybraga on May 12, 2016, 11:56:20 pm
1. Why postRender isn't called for summary cells ?
2. Why can't I call refreshCell for a summary cell ?

I am using the summaryData option to render a summary at the bottom of my grid and I want to manually refresh some of those cells at specific moments.
Title: Re: Refresh summarydata cell
Post by: paramvir on May 13, 2016, 09:41:44 am
Set the summaryData option whenever you want to refresh whole or part (cells) of summary rows.

Code: [Select]
grid.option( 'summaryData', new_summary_data );

Example: http://paramquery.com/pro/demos/summary
Title: Re: Refresh summarydata cell
Post by: billybraga on May 13, 2016, 04:44:15 pm
So what you propose is to do this ?

Code: [Select]
$("#grid").pqGrid("summary", "summaryData", [ { property: value } ])
It doesn't seem to re-render the summary cell(s).
Title: Re: Refresh summarydata cell
Post by: paramvir on May 13, 2016, 05:55:10 pm
Please share a jsfiddle so that I can look into it.
Title: Re: Refresh summarydata cell
Post by: billybraga on May 13, 2016, 07:39:13 pm
https://jsfiddle.net/2kg6equo/15/ (https://jsfiddle.net/2kg6equo/15/)
Title: Re: Refresh summarydata cell
Post by: paramvir on May 17, 2016, 02:35:05 pm
Grid requires a refresh after summary data is assigned from an external function.

http://jsfiddle.net/kqag7bvh/
Title: Re: Refresh summarydata cell
Post by: billybraga on May 17, 2016, 04:49:40 pm
That is exactly what I am trying to avoid. I don't want to repaint the grid each time something changes in the summary.
Title: Re: Refresh summarydata cell
Post by: paramvir on May 17, 2016, 05:35:03 pm
Quote
I don't want to repaint the grid each time something changes in the summary.

May I know the reason?

Normally the summary data is dependent upon data in the grid, so when data changes in the grid ( typically due to editing or filtering ), grid main data and summary data are shown/ refreshed in a single repaint and repaint of the grid is quite fast in virtual mode.

Anyway the ability to repaint only the summary table can be get from createTable() API.

http://paramquery.com/pro/api#method-createTable

and if you are still not content and want the full infrastructure of main grid like postRender and refreshCell, you could probably use link scrolling to show summary grid underneath the main grid.

http://paramquery.com/pro/demos/scroll
Title: Re: Refresh summarydata cell
Post by: billybraga on May 17, 2016, 05:39:17 pm
The reason is that I am integrating knockoutJS in the grid. The cells are knockout templates bound to javascript objects containing knockout observables. Their content are automatically updated by the knockoutjs library and I refresh only the parts of the grid I need depending if the cell height changes. The summary cells are also bound to knockout observables so I would like to refresh them individually to avoid rebinding each and every cell of the grid to their knockout template and context.

I'll look into the links you provided.