Author Topic: loadState failed when loading a grid (8.0.1)  (Read 2717 times)

nzxgq0

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 25
    • View Profile
loadState failed when loading a grid (8.0.1)
« on: July 07, 2021, 03:25:03 pm »
I have a pqgrid with the pivot feature.
However it fails when loading the grid with the state maintenance (https://paramquery.com/pro/demos/grid_state).
It looks "this.panes" is not initialized when calling the method.
Any idea?
Code: [Select]
22794      setAttrPanes: function() {
22795        this.$ele.attr("panes", this.panes.filter(function($ele) {
22796                return $ele.is(":visible")
22797            }).length)
22798        }


Uncaught TypeError: Cannot read property 'filter' of undefined
    at _pq.cToolPanel.setAttrPanes (pqgrid.dev.js:22795)
    at _pq.cToolPanel.showHideColPane (pqgrid.dev.js:22819)
    at _pq.cToolPanel.setHtml (pqgrid.dev.js:22773)
    at _pq.cToolPanel.refresh (pqgrid.dev.js:22717)
    at _pq.cToolPanel.onGroupOption (pqgrid.dev.js:22643)
    at handleListeners (pqgrid.dev.js:791)
    at $.<computed>.<computed>._pq._trigger (pqgrid.dev.js:836)
    at _pq.cGroup.option (pqgrid.dev.js:15838)
    at _pq.cGroup.option (pqgrid.dev.js:22358)
    at $.<computed>.<computed>.fn.loadState (pqgrid.dev.js:8784)
« Last Edit: July 07, 2021, 03:29:35 pm by nzxgq0 »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: loadState failed when loading a grid (8.0.1)
« Reply #1 on: July 08, 2021, 09:21:37 am »
nzxgq0

I'm able to reproduce the issue while loadState with pivot, moving it to bug log for further analysis.

nzxgq0

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: loadState failed when loading a grid (8.0.1)
« Reply #2 on: July 08, 2021, 09:49:07 am »
nzxgq0

I'm able to reproduce the issue while loadState with pivot, moving it to bug log for further analysis.

Thanks. With the following option, loadState always fails. I hope we can have a quick solution.
        toolPanel: {
            show: true  //show toolPanel initially.
        }

nzxgq0

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: loadState failed when loading a grid (8.0.1)
« Reply #3 on: July 13, 2021, 04:16:47 pm »
another issue related to the pivot grid is that  some of the grid themes (JQuery themes such as Dark Hive, Dot Luv, Egg Plant, etc.) don't work well on the tool panel.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: loadState failed when loading a grid (8.0.1)
« Reply #4 on: September 01, 2021, 02:28:45 pm »
these issues have been resolved in v8.1.0

nzxgq0

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: loadState failed when loading a grid (8.0.1)
« Reply #5 on: September 03, 2021, 03:50:58 pm »
Hi paramvir, this is a great news.

I tried Pro 8.1.0 and the issue mentioned above is fixed. However, it doesn't seem to support to restore the pivot state and the filters if any.
Meaning that if a Web user switched the grid from the normal mode to the pivot mode and left, it still displays the grid at the normal mode (the checkbox of pivot mode not checked and the columns are for normal mode) when coming back to that page.

I noticed that the pivot flag of the groupModel actually was not saved in the localStorage.  Any luck to enable it?

Thanks.

« Last Edit: September 03, 2021, 03:57:04 pm by nzxgq0 »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: loadState failed when loading a grid (8.0.1)
« Reply #6 on: September 18, 2021, 04:54:15 pm »
pivot is also supported

It has to enabled by adding groupModel.pivot to stateKeys option.

Code: [Select]
         
    stateKeys: { groupModel: ['dataIndx', 'collapsed', 'grandSummary', 'nodeClose', 'pivot'] },