jQWidgets Forums

jQuery UI Widgets Forums General Discussions jqxpivotgrid total height , autoresize

This topic contains 4 replies, has 2 voices, and was last updated by  Hristo 7 years, 1 month ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author

  • hhm8152
    Participant

    Hi, I’m trying to use autoresize in the jqxpivotgrid (React)
    IF i have limit size div (height:400px; width:400px), but there are 2000 rows. I hope to use autoresize. But in this case, vertical scroll bar didn’t appear so I can’t see bottom row. Is there any way to use autoresize and generate vertical scroll bar?

    
        <div className={'pivot-table'}>
          <JqxPivotGrid
            style={{width, height}}
            source={data}
            treeStyleRows = {false}
            autoResize={true}
            multipleSelectionEnabled = {true}
          />
        </div>
    

    Hristo
    Participant

    Hello hhm8152,

    You could calculate the all rows before the initialization of the PivotGrid and after that with a few fine calculations to set suitable height.
    For example you could get all rows by DataAdapter – var rows = dataAdapter.records; var height = rows + '10px';

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com


    hhm8152
    Participant

    Can you give a demo code?


    hhm8152
    Participant

    I mean if width is 20000px, how can I solve it?


    Hristo
    Participant

    Hello hhm8152,

    I still cannot understand what you want to achieve.
    You want to resize the PivotGrid on that way to see all rows and at the same time, you want to have a vertical scrollbar.
    The examples that I tested have the scrollbars.
    If you want the PivotGrid to shows all rows without vertical scrollbar you could try the approach described below.
    In the componentDidMount get all rows of the PivotGrid by let rowsLength = this.refs.myPivotGrid.getPivotRows.items.length;
    Default height of the rows is 25px then calculate let rowsHeight = rowsLength * 25;. Also, you should include the columns headers and the horizontal scrollbar (if it exist).
    The whole height of the PivotGrid should be let height = rowsHeight + scrollbarHeight + columnsHeight;.
    After that you should set this value to the PivotGrid and .refresh(); it (the all this code in the “componentDidMount”).

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.