Custom fetch event

Components that support data fetching, can have a custom fetch implemented, by using the setCustomFetch method. This method accepts a FetchEvent interface implementation as a parameter. This custom fetch operation will be called instead of the default JBStrap data fetch implementation. You can use the custom fetch to implement custom solutions, such as allowing data stored in a cloud storage to be displayed in a listgrid. The onFetch method returns with a list, which is passed to the component when calling the fetch. The fetch event can be triggered if a component is displayed, the contents are scrolled, or a next page is to be loaded, etc.

The FetchEvent interface requires the implementation of the onFetch method, which has to have the following fetch parameters:

  • startRow The first row of the query that appears in the returned list
  • endRow The last row of the query that appears in the returned list
  • criteria The criteria used during the query If null, no criteria will be used, every record is queried.
  • orders The orderings that will be applied to the query results. If null, the data will not be ordered.
  • client The client that started the query. If null, the query will happen without checking for access rights.

Specifying a custom fetch with a combobox:

Components that support the Custom fetch:

  • ActivityStream
  • Calendar
  • ComboboxItem
  • DualListBox
  • RadioButtonItem
  • ListGrid
  • Sparkline
  • Timeline
  • Treeview