ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: kadyrsizov on August 30, 2019, 12:53:15 pm
-
Hi there
I've implemented grid which uses rows and cols grouping (pivot mode) with remote data model. When I call refreshDataAndView method grid's view doesn't render updated data and displays empty view
Example:
http://jsfiddle.net/kL0gbav9/12/
Just press RefreshDataAndView button
What is the correct way to refresh data and view in the pivot mode?
-
Thanks for sharing jsfiddle.
Turn off pivoting before refreshDataAndView()
listener: function (evt) {
this.Group().option({on:false, pivot: false})
this.refreshDataAndView();
}
and recreate pivot in complete event
complete: function(){
this.Group().option({pivot: true, on: true})
},
https://jsfiddle.net/4eakqptm/
-
Thanks for the solution!
In my implementation user has ability to switch between pivot mode and not pivot mode dynamically and I can't enable pivot mode every time when complete event fires. Now I have to use some flag to manage this situation.
Is it possible implement this feature into the grid's core in next versions?
-
No need to use a global flag. complete event handler can be written inside the listener itself.
listener: function (evt) {
var on = this.option('groupModel.on'),
pivot = this.option('groupModel.pivot');
this.Group().option({pivot: false, on: false})
this.refreshDataAndView();
this.one('complete', function(){
this.Group().option({pivot: pivot, on: on})
})
}
https://jsfiddle.net/9bon57we/
-
Good idea! Thanks