3.2 Page-specific changes
Changes to certain pages must be programmed in page-specific javascript files in hooks
directory. You can make changes to the table view (tv) or to the detail view (dv).
Table View
- if your table is called
xyz
...- ... the source code for table-view changes must be stored in
hooks/xyz-tv.js
- ... the source code for table-view changes must be stored in
Detail View
- if your table is called
xyz
...- ... the source code for detail-view changes must be stored in
hooks/xyz-dv.js
- ... the source code for detail-view changes must be stored in
3.2.1 Apply "compact" mode to detail view
- Create an empty file
TABLENAME-dv.js
in yourhooks
-folder
ReplaceTABLENAME
by the exact name of your table.
If your table ispatients
, the filename has to bepatients-dv.js
.
Pay attention to the uppercase and lowercase letters. - Insert the following code
- Save the file and
- Reload the detail view in the browser
var dv = AppGiniHelper.DV; dv.compact();
The deafult detail view has been modified at certain areas, for example the size of then buttons has been reduced:
3.2.2 Add a button to detail view
- Add the following code to the end of the file
- Save the file and
- Reload the detail view in the browser
var actionbuttons = dv.actionbuttons; var group = actionbuttons.addGroup("Additional Buttons"); group.addButton("Click me!", function () { alert("Clicked!"); });
File: hooks/TABLENAME-dv.js
There should be an additional button at the right hand side of your detail view form. Click the button, a message box will open up.