Choose Language Hide Translation Bar
Super User

Object Oriented JSL - Datatable Object - Useful to have datatable extensions?

This was originally posted here: Object-Oriented JSL - Examples? but I wanted to isolate this topic of OOP and the concept of the Datatable Object.

First, in my opinion the datatable itself can already be thought of as an object.

dt1 = NewTable() -    Creates new "instance" of Datatable

ShowProperties(dt1) -  Show all the "properties" and "methods" for the Datatable object dt1.

I'm intrigued to know if the community would find Datatable extensions useful. One can think about "extending" the existing Datatable Object with additional properties and methods, as in Drew's reply. I thought about having additional features like:

1. Rowstate Handler.

2. Column and Row, Add/Delete detection.

3. Table cell change history.

4. Databox (Displaybox)

So, in OOP terminology, a possible "constructor" for the DatatableObject could look like, where member variables and functions are declared.

The idea behind declaring the object this way, is not only establish a replicable entity, but also allows one to clearly see the functions and expression names that will become usable once they are fully defined.

12645_Screen Shot 2016-08-25 at 12.32.23 PM.png

My version of the NewDatatableObject (partial listing). Here is where the member functions are actually defined:

12646_Screen Shot 2016-08-25 at 12.31.20 PM.png

   12647_Screen Shot 2016-08-25 at 1.17.43 PM.png

So for example, we create 2 separate instances of DatatableObject:

12648_Screen Shot 2016-08-25 at 12.47.23 PM.png

These tables now have "extended" properties built-in. In this example, some table actions are tracked, such as detecting row selection and Column/Row deletions.

12649_Screen Shot 2016-08-25 at 1.07.03 PM.png12650_Screen Shot 2016-08-25 at 1.06.06 PM.png

One can imagine a host of other useful functions as well, that could be implemented using this method. Do others agree there's a case for creating such extensions?

0 Kudos