TreeGrid v7.0
Paging columns
TreeGrid can automatically split middle columns to pages and displays them only on demand – when the page becomes visible due scroll.
<Cfg> int ColPaging [0] new 7.0 .
Method of column paging used.
0 No paging
All columns are in one page. All columns are rendered on start. This means slow start and fast use.
It is good for small grids, up to about 30 columns.
1 Show all
Column pages are automatically created, but all are rendered on start.
It is good for medium grids, 30 – 100 columns, to let users to easy navigate between parts in grid.
It can be used also to avoid browser “Slow script” message when rendering too many rows without paging.
2 Client paging (auto – fully done by TreeGrid)
Column pages are automatically created
The column page is rendered only when it is visible in window by scrolling.
It is good for large grids with more than 100 columns. All functions still work offline, include sorting, filtering, grouping, searching and calculations.
The client paging does not require any server side support.
<Cfg> int ColPageMin [10] new 7.0 .
Count of column in the first (left) page.
This page is rendered always on start, so it is displayed immediately with grid.
It can be set to 0 to not render any column on start.
<Cfg> int ColPageLength [10] new 7.0 .
Count of columns per page, except the first one and the last one.
Exact count of columns in page can differ due to adding or deleting columns.
Every page must contain at least one column otherwise it is deleted.
<Cfg> int PageTime [200] .
How long (in ms) must be page visible (by scroll) before it renders.
<Cfg> int MaxColPages [20] new 7.0 .
Maximum rendered column pages in grid, only for ColPaging = ‘2’.
When grid contains more rendered pages, the pages longer not accessed are cleared (only in HTML, pages data are not affected).
Used to not slow down the browser when too many HTML tags are displayed.
For large pages you can lower this value.
The actually displayed pages are never cleared.
Set it to 0 to disable clearing pages.
<C> int Width Saved to cookies, avoid it by <C WidthLap=’1’/> .
Column width in pixels. It is outer width including all side buttons, cell border and padding.
Set it when there are many columns in grid to speed up grid loading
<C> bool Prepared new 7.0 .
If all row values in this column are prepared and do not need to be updated on start.
Use it when the grid has many rows to speed up grid loading.
The preparing values does these things:
- Date type cell values set as strings are converted to numbers as count of milliseconds since 1/1/1970.
- Int and Float types empty values are converted to zero if set CanEmpty.
- Select type is converted to Button=’Defaults’
- For Calculated rows without CalcOrder is the CalcOrder created from all (not Prepared) columns with Formula attribute.
You can set Prepared=’1’ for columns that does not contain Date, Int, Float and Select types or the Date are set as numbers or the Float and Int are not source of calculations.
API event void OnRenderColPageStart (TGrid grid, int sec) new 7.0 .
Called before rendering of the column page.
The sec is the section index to ColNames.
API event void OnRenderColPageFinish (TGrid grid, int sec) new 7.0 .
Called the column page is fully rendered and ready.
The sec is the section index to ColNames.
API method void AddColPage (string[] names, string def = “C”) new 7.0 .
Adds new column page to the end of variable columns.
names is list of the column names to add. It can be also number as count of the columns to add.
def is name of default column to use for all the columns to fill their attributes.
After the method finishes, the columns are not displayed yet, so they can be changed or the row values in the columns can be filled directly.
API method void ShowColPages ( ) new 7.0 .
Starts loading and rendering displayed column pages. Asynchronous.
Call this method if pages are not rendered automatically when you do some unusual changes in grid.