You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Enhanced table_sql functionality with advanced features and a modern, responsive interface**
2
3
3
-
TODO
4
+
Moodle provides a `table_sql` class for building tables through a unified API. However, it lacks modern features such as AJAX-based pagination and filtering.
4
5
5
-
## Licenses for JavaScripts
6
+
`local_table_sql` is a drop-in replacement for Moodle’s core `table_sql` class and adds a wide range of powerful enhancements, including AJAX navigation, full-text search and advanced filtering for each column.
6
7
7
-
see: LICENSE.js.txt
8
+
Plugins can declare this plugin as a dependency in their `version.php`.
9
+
Tables built using `local_table_sql` provide the following features:
10
+
11
+
## Key Features
12
+
13
+
-**AJAX-driven data loading** – Load only the data that is needed, improving performance.
14
+
-**Built-in filtering and sorting** – Global search or column-specific filters included.
15
+
-**Full-text search support**
16
+
-**Dynamic column visibility** – Show or hide columns instantly.
17
+
-**Customizable UI actions** – Add action buttons or context menus for each row.
18
+
-**Row selection and bulk actions**
19
+
-**SQL-based data source** – Provide your own SQL query as input.
20
+
-**Custom form integration** – Display forms for adding or editing rows.
21
+
22
+
23
+
## Usage
24
+
25
+
See the demo folder for example usage of the `local_table_sql` plugin.
26
+
27
+
## Information for developers regarding the react-app directory
28
+
29
+
The `react-app` directory contains the React frontend responsible for rendering table data, built using **Material React Table**.
30
+
31
+
To build the React app (only needed if you made changes to the react code, a precompiled version is included in the plugin):
32
+
33
+
1. Run the script:
34
+
```bash
35
+
cd react-table
36
+
./build.sh
37
+
```
38
+
39
+
2. The compiled output will be copied into the js/main.js directory.
40
+
41
+
The react-app directory is not required for normal plugin usage**—only for development**.
42
+
It is included in the repository for transparency and open-source collaboration.
@@ -175,6 +176,32 @@ public function __construct($uniqueid = null) {
175
176
}
176
177
}
177
178
179
+
/**
180
+
* Returns a class name. For anonymous classes, it returns the file path and line number, which IS NOT stable against code changes above the class definition.
181
+
* But good enough for us
182
+
* PHP's get_class() on anonymous functions also returns file + line number, but also adds some random string
183
+
* And that is not exactly defined in the PHP manual
0 commit comments