Author Topic: dimsRelativeTo is not used by cRefresh.getParentDims function  (Read 698 times)

[email protected]

  • Pro OEM
  • Newbie
  • *
  • Posts: 12
    • View Profile
I am currently using version 8.0.1.

I have defined the dimsRelativeTo property for my grid. This works well in most cases but when the browser window is resized by dragging the window edges the parent dimensions returned by the cRefresh.getParentDims function are those of the direct parent not the parent defined in dimsRelativeTo. In my case this causes the grid to be sized outside of the dimsRelativeTo parent bounds.

The code calling getParentDims is line 8059 in pqgrid.dev.js and is shown below:

Code: [Select]
            if (isReactiveDims) self.setResizeTimer(function() {
                arr = self.getParentDims(), newWdParent = arr[0], newHtParent = arr[1];
                if (newHtParent == htParent && newWdParent == wdParent) {
                    if (parseInt($grid.width()) == parseInt(dims.wdGrid)) {
                        return
                    }
                } else {
                    dims.htParent = newHtParent;
                    dims.wdParent = newWdParent
                }
                self.refresh({
                    soft: true
                })

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: dimsRelativeTo is not used by cRefresh.getParentDims function
« Reply #1 on: May 17, 2022, 10:20:29 am »
James

Thanks for mentioning the issue. Could you please share a jsfiddle so that I can check it.

[email protected]

  • Pro OEM
  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: dimsRelativeTo is not used by cRefresh.getParentDims function
« Reply #2 on: May 17, 2022, 10:47:59 pm »
I created a JSFiddle that demonstrates the issue.

Repro Steps:
  • Go to https://jsfiddle.net/jhschmidt/o30c92zd/33/
  • Observe that the grid view and its vertical scrollbar are fully visible
  • Drag the bottom of the CSS pane up to enlarge the grid view
  • Observe that the grid view and its vertical scrollbar resize properly and are fully visible
  • Drag the bottom of the CSS pane down to shrink the grid view
  • Observe that the grid view and its vertical scrollbar do not resize and are not fully visible

Thanks for your help,
Jim

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: dimsRelativeTo is not used by cRefresh.getParentDims function
« Reply #3 on: May 17, 2022, 11:36:26 pm »
That's issue with 100% height, I would look further into it.

For now, height: 99% or any value other than 100% works

https://jsfiddle.net/jvf3p6c1/1/

[email protected]

  • Pro OEM
  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: dimsRelativeTo is not used by cRefresh.getParentDims function
« Reply #4 on: May 17, 2022, 11:55:13 pm »
Using 99% will work fine for me as a workaround.

Thanks for the quick reply!