Page History
...
Code Block | ||
---|---|---|
| ||
myFoundset: { serverSize: 44, // the size of the foundset on server (so not necessarily the total record count in case of large foundsets) // this is the data you need to have loaded on client (just request what you need via provided loadRecordsAsync or loadExtraRecordsAsync) viewPort: { startIndex: 15, size: 5, rows: [ { _svyRowId: 'someRowIdHASH1', nameColumn: "Bubu" }, { _svyRowId: 'someRowIdHASH2', nameColumn: "Yogy" }, { _svyRowId: 'someRowIdHASH3', nameColumn: "Ranger" }, { _svyRowId: 'someRowIdHASH4', nameColumn: "Watcher" }, { _svyRowId: 'someRowIdHASH5', nameColumn: "Hatcher" } ], //** requestRequest a change of viewport bounds from the server; the requested data will be loaded asynchronously in 'viewPort' * @param startIndex the index that you request the first record in "viewPort.rows" to have in the real foundset (so the beginning of the viewPort). * @param size the number of records to load in viewPort. */ loadRecordsAsync: function(startIndex, size), //** requestRequest more records for your viewPort; if the argument is positive more records will be loaded at the end of the 'viewPort', when negative more records will be loaded at the beginning of the 'viewPort' - asynchronously. * @param negativeOrPositiveCount the number of records to extend the viewPort.rows with before or after the current loaded records. */ loadExtraRecordsAsync: function(negativeOrPositiveCount) }, selectedRowIndexes: [16], // can be out of viewPort as well multiSelect: false } |
Initially the viewPort is an empty array (size 0) and startIndex is 0 as well. Client side JS can watch the value of serverSize and when recods become available it can request the desired Viewport using loadRecordsAsync.
If more records need to be shown besides the already loaded ones use loadExtraRecordsAsync.
Design value (generated visually by form designer and written in .frm file, so Servoy users don't need to know about it)
...
Overview
Content Tools
Activity