How to edit the view details button in the children-table?

This sub-forum is for discussing all topics related to AppGini Helper JavaScript Library, provided by bizzworxx as a third-party AppGini plugin.
Post Reply
User avatar
lramirez
Veteran Member
Posts: 61
Joined: 2019-11-01 23:23

How to edit the view details button in the children-table?

Post by lramirez » 2024-05-27 17:34

Hello Jan, thank you for your help... I customized the button according to the guides you give us (for a better understanding of the end user)

but I also want to customize the button that is in table-children, is there a guide? (I changed it but in the templates folder, children-file.php) but there is the problem that every time I compile it returns to its default form. like the images I sent.

thanks for your help.
Attachments
bolet2.png
bolet2.png (16.22 KiB) Viewed 744 times
bolet.png
bolet.png (14.78 KiB) Viewed 744 times
boleta3.png
boleta3.png (73.2 KiB) Viewed 744 times
Luis Ramirez R.

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1869
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: How to edit the view details button in the children-table?

Post by jsetzer » 2024-05-28 03:46

How to replace default links in children tabs by Bootstrap-styled buttons
chrome_E6fqcNAVn4.png
chrome_E6fqcNAVn4.png (1.13 KiB) Viewed 733 times
Good morning,

please find the following code which creates custom edit-buttons in children-tabs:

I. Open record in modal dialog

The function .addButtonOpenModal() replaces the default link:

Code: Select all

// file: hooks/TABLENAME-dv.js
// open in modal dialog
AppGiniHelper.dv.getChildrenTabs().addButtonOpenModal();
Output

chrome_40WO8LbsFZ.png
chrome_40WO8LbsFZ.png (24.83 KiB) Viewed 733 times

II. Open record in active tab

Wanna open record in the current tab instead of modal dialog? You can use .addButtonOpen().

Code: Select all

// file: hooks/TABLENAME-dv.js
// open in tab
AppGiniHelper.dv.getChildrenTabs().addButtonOpen();

III. Custom button

Code: Select all

// file: hooks/TABLENAME-dv.js
// custom button
AppGiniHelper.dv.getChildrenTabs().addButtonOpen("pencil", "Edit", "Edit this record in a new tab", "_blank");
Parameters
  1. icon name
    for example pencil, cog, option-horizontal
    Tip: See icons here
  2. button text
  3. Tooltip
  4. target
    for example _self, _blank, myBroswerTabName


Output

chrome_zscu0GSK9d.png
chrome_zscu0GSK9d.png (10.38 KiB) Viewed 733 times

Please note:
  • Those changes in hooks/TABLENAME-dv.js will not be overwritten on next code-generation.
  • Those children-tab-panels will be reloaded automatically on changes and every n seconds. Our library reacts to reloads and automatically restores those custom buttons, so you don't have to worry about this.
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.14 Revision 1665 + all AppGini Helper tools

User avatar
zibrahim
Veteran Member
Posts: 154
Joined: 2020-01-28 18:30
Location: Malaysia

Re: How to edit the view details button in the children-table?

Post by zibrahim » 2024-05-31 11:18

Hi Jan,
I tried the code but I got the following error in console
Uncaught TypeError: AppGiniHelper.dv.getChildrenTabs().addButtonOpen is not a function
I am using AppGiniHelper Javascript Library Version 2023.01.04.2
Thanks.
Zala.
Appgini 24.17, MacOS 14.6 Windows 11 on Parallels.

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1869
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: How to edit the view details button in the children-table?

Post by jsetzer » 2024-05-31 12:26

First, can you please check if AppGiniHelper.DV.getChildrenTabs() works.

If so, please check the following:
  1. Open that detail view
  2. Open browser's dev-tools (F12)
  3. In console-tab type the following command and watch the auto-completion:
    AppGiniHelper.dv.getChildrenTabs().add

    auto-suggestions while you type:
    chrome_utYqJQOSaS.png
    chrome_utYqJQOSaS.png (16.41 KiB) Viewed 665 times
In lastest version there are two methods addButtonOpen and addButtonOpenModal. I don't know exactly when we have added them to the library, perhaps after January 2023. If those functions are not available for you, you may consider updating your version.
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.14 Revision 1665 + all AppGini Helper tools

User avatar
lramirez
Veteran Member
Posts: 61
Joined: 2019-11-01 23:23

Re: How to edit the view details button in the children-table?

Post by lramirez » 2024-05-31 13:42

Hello Jan, good morning...
I did the tests and it doesn't run... errors appear:

// Uncaught TypeError: AppGiniHelper.DV.getChildrenTabs().addButtonOpenModal is not a function
// Uncaught TypeError: AppGiniHelper.dv.getChildrenTabs().addButtonOpen is not a function

-- I have the latest version of AppGiniHelper-20230104 --

Greetings from Panama...
Thank you
Attachments
reporte31.png
reporte31.png (6.1 KiB) Viewed 657 times
Luis Ramirez R.

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1869
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: How to edit the view details button in the children-table?

Post by jsetzer » 2024-05-31 13:50

Please send...

1) The output of AppGiniHelper.dv.getChildrenTabs()
2) your order number

By email.
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.14 Revision 1665 + all AppGini Helper tools

User avatar
lramirez
Veteran Member
Posts: 61
Joined: 2019-11-01 23:23

Re: How to edit the view details button in the children-table?

Post by lramirez » 2024-05-31 15:27

ready Jan, I already sent the email to [email protected] <[email protected]>
Luis Ramirez R.

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1869
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: How to edit the view details button in the children-table?

Post by jsetzer » 2024-05-31 15:50

Already answered your email.
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.14 Revision 1665 + all AppGini Helper tools

User avatar
lramirez
Veteran Member
Posts: 61
Joined: 2019-11-01 23:23

Re: How to edit the view details button in the children-table?

Post by lramirez » 2024-07-15 04:14

Thank you very much, this was exactly what I wanted to do....

https://forums.appgini.com/phpbb/viewto ... 9DJQrQqe8g
Luis Ramirez R.

Post Reply