Our blazing fast Grid component built with pure JavaScript


Post by prashantgoel »

Hello:

We have a page where users select from a list of question and depending on what they select, the grid may be quite wide (lots of columns).

In an extreme case we recently ran into, 200+ questions were selected and it took over a full minute to add these number of columns to the grid. Any suggestion on how we can improve the performance?

            for (var cols in data.options.columns) {
data.options.columns[cols].data);
                    grid.columns.add({
                        text: data.options.columns[cols].title, 
                        field: data.options.columns[cols].data,
                        type: (data.options.columns[cols].dataType.toUpperCase() == "DATETIME" ? 'date' : ''),
                        htmlEncode: false,
                        autoHeight: true,
                        hidden: (["cityOfBirth", "dateOfDeath", "sexOnBirth", "countryOfResidence", "stateProvinceRegionOfResidence", "countryOfBirth", "relationship", "studyOptIns"].includes(data.options.columns[cols].data)),
                    })
                    }

Post by alex.l »

Hi, sure

You can add all columns at once instead of one by one.
Please see docs https://bryntum.com/products/grid/docs/api/Grid/data/ColumnStore#function-add

All the best,
Alex


Post by prashantgoel »

This worked great. Thank you!


Post Reply