iDatasource.d.ts 1.0 KB

12345678910111213141516171819202122232425
  1. /** Datasource used by both PaginationController and InfiniteRowModel */
  2. export interface IDatasource {
  3. /** If you know up front how many rows are in the dataset, set it here. Otherwise leave blank.*/
  4. rowCount?: number;
  5. /** Callback the grid calls that you implement to fetch rows from the server. See below for params.*/
  6. getRows(params: IGetRowsParams): void;
  7. destroy?(): void;
  8. }
  9. /** Params for the above IDatasource.getRows() */
  10. export interface IGetRowsParams {
  11. /** The first row index to get. */
  12. startRow: number;
  13. /** The first row index to NOT get. */
  14. endRow: number;
  15. /** Callback to call for the result when successful. */
  16. successCallback(rowsThisBlock: any[], lastRow?: number): void;
  17. /** Callback to call when the request fails. */
  18. failCallback(): void;
  19. /** If doing server side sorting, contains the sort model */
  20. sortModel: any;
  21. /** If doing server side filtering, contains the filter model */
  22. filterModel: any;
  23. /** The grid context object */
  24. context: any;
  25. }