WebDataSource pointers please

Would appreciate a pointer towards how the WebDataSource class is used, before I go re-inventing wheels.

How does WebDataSource relate to a query or table for instance?

The documentation is sparse and circular to say the least.

I’m working with an SQLite database if it makes a difference.

Thanks.

WebDataSource is the interface with which you supply data about the rows to the WebListbox. The WebListbox will display the rows, but it will ask you for what that data is by supplying the offset and count of rows that the WebListbox wants to display.

This lets you display just the 50 rows you need, instead of loading 2000 rows and sending them to the browser.

Your code is responsible for the SQLite search query (which includes any filtering). The RowData method provides the OFFSET and LIMIT values as the parameters RowOffset and RowCount respectively. The WebListbox will call this RowData method as needed to display just a range of currently relevant rows.

2 Likes

Thanks Tim

To clarify

  1. Create a query object that populates a rowset.
  2. Add WebDataSource to the query object from the Interfaces list.
  3. Populate the interface methods.
  4. Set the list box DataSource property to an instance of my query object

Is that it?