<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />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.

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


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

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.


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?