3B. Upgrading BBjGrids

Learn about the steps needed to upgrade existing code written for BBjStandardGrid to BBjGridExWidget.

1. Overview

The DWC does not offer a direct 1:1 API compatible implementation of the BBjStandardGrid and its siblings, BBjDataAwareGrid and BBjDataBoundGrid. The reason for that is that these grid have been written with a legacy 1-tier architecture in mind. When they were brought over to BBj with its Thin Client Architecture, their API could not be implemented in the same performance, as the event callbacks and routines these grids offered through their API result in a substantial amount of round trips between the server and the client.

The BBjGridExWidget Plug-in has been written with best-possible performance for the Thin Client and the Web Browser in mind. It's build on a leading 3rd party implementation of a powerful data grid, built in JavaScript and TypeScript. The BBjGridExWidget works well in the DWC, which is why this course proposes it as one potential upgrade path for your existing data grids.

The BASIS Documentation hosts an intro page about the BBjGridExWidget Plug-In. As most Plug-Ins for BBj, it is hosted with its source code on GitHub at https://github.com/BBj-Plugins/BBjGridExWidget.

Differences between the BBjStandardGrid and BBjGridExWidget

While the BBjStandardGrid is typically filled cell-by-cell or using a BBjVector structure that holds the data for the entire grid or a set of consecutive cells, the BBjGridExWidget is strictly built as a data grid based on a collection of records. These records correspond to the rows of the grid, while the field list inside the records define the set of columns of the grid. Next to the core data types of the BBx language - String, Numeric and Integer values - the BBjGridExWidget and the basiscomponents library that is providing the underlying data structures can handle the most common SQL data types. By doing so, the grid natively supports the display and data entry for Boolean types, Dates and Timestamps, in a declarative way. No separate code is needed to convert from and to Strings, and if the underlying database is a standard SQL database like BBj ESQL or products like MySQL or Postgres, the data flows as efficient as possible between the database and the user interface.

The BBjGridExWidget also offers a few functions for user convenience, like drag and drop of columns, switching of visibility and many more. In the enhanced version which can be rented at affordable cost it provides more features like pivot tables, tree grid display or charting. 

Refer to the plug-in's homepage and the overview document to learn more.