Setting row count after set up

4 posts, 0 answers
  1. John
    John avatar
    21 posts
    Member since:
    May 2015

    Posted 24 Dec 2015 Link to this post

    I am trying to set the max row count after I retrieved the data from AJAX call. The default option for the number of rows is 200. I am needing to be able to change this number based on the number of rows returned from AJAX call. I want the page to have to have the default of 200 when the page loads.

    The user then chooses from a dropdown on the page to query the backend for data which will have a different number of rows each time. I was hoping to be able to just set the rows property on the sheet.options object, but it does not look like these values are re-read after initialization.

    How should I do this? Especially if I am going to have multiple tabs of data with different number of rows.


  2. John
    John avatar
    21 posts
    Member since:
    May 2015

    Posted 24 Dec 2015 Link to this post

    Another reason for this question is it just suggested to set this value to really large number if I have multiple tabs?

    For Example:

    Tab 1: 20 rows
    Tab 2: 100 rows
    Tab 3: 2000 rows
    Tab 4: 500 rows

    If the max count defaults to 200, the tabs with more 200 rows will fail. If I just set the max row count to 2000 rows, all of tabs will display, but now the tabs with only a few rows like Tab 1 will have over 1,000 blank rows.


  3. Dimiter Madjarov
    Dimiter Madjarov avatar
    2312 posts

    Posted 25 Dec 2015 Link to this post

    Hello John,

    You could use the insertSheet method to add new sheets with specific options to the Spreadsheet. The object which is passed as a parameter to the method should have an options.rows configuration which specifies the number of rows in the new sheet.

    Dimiter Madjarov
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  4. Tim
    Tim avatar
    19 posts
    Member since:
    Jul 2014

    Posted 08 Feb 2018 in reply to Dimiter Madjarov Link to this post

    I just ran into this issue of wanting to expand the # of rows by one from a fixed row length sheet. Here is a direct and fast way to add a row in just a few lines of code that handles the copy data/reset sheet and everything in a simple call and also preserves hidden column attributes:

                var workbook = yourKendoWorkSheet.toJSON();
                workbook.rows = workbook.sheets[0].rows.push({}); // push x empty rows if you'd like, the {} can also be a full row option set

    Hope this helps someone

Back to Top