Click on one of rows and show detail view in modal or pop-up window for add/edit
-
- Posts: 20
- Joined: 2017-03-12 09:32
Click on one of rows and show detail view in modal or pop-up window for add/edit
Looking for something like click on one of rows from the table and show detail view in modal or pop-up window for add/edit info then save it, return to table?
Re: Click on one of rows and show detail view in modal or pop-up window for add/edit
Hello D Campbell,
you can do it by adjusting the behavior of td on clicking on it
first you will insert your code in tablename-tv.js you will create this file in the hooks folder
then you will need some code like that
$j(function(){
//catch the behavior of clicking on any td , prevent it's defulat , the preventDefault dosn't work try to test it and then put your modal of pop up code in the file
$j("td a").click(function(event){
event.preventDefault();
//put your modal or popup behaviour here
})
})
The idea that in normal behavior on clicking on any record it submits a form and open a form for editing , we will jsut change it's behviour to be open in modal or pop up
hope it will help you
Regards,
Reham
you can do it by adjusting the behavior of td on clicking on it
first you will insert your code in tablename-tv.js you will create this file in the hooks folder
then you will need some code like that
$j(function(){
//catch the behavior of clicking on any td , prevent it's defulat , the preventDefault dosn't work try to test it and then put your modal of pop up code in the file
$j("td a").click(function(event){
event.preventDefault();
//put your modal or popup behaviour here
})
})
The idea that in normal behavior on clicking on any record it submits a form and open a form for editing , we will jsut change it's behviour to be open in modal or pop up
hope it will help you
Regards,
Reham
Re: Click on one of rows and show detail view in modal or pop-up window for add/edit
Any chance anyone can give an example of the code to use for this?
I would like to open detailed.dv views in a modal when selected from table.tv table. Tried to figure it out but no success yet!
Cheers, Ron
I would like to open detailed.dv views in a modal when selected from table.tv table. Tried to figure it out but no success yet!
Cheers, Ron
Ron - Gloucestershire, UK: AppGini Pro V 23.15 Rev 1484 - LOVING IT!
Plugins: Mass Update + Search Page Maker + Summary Reports + Calendar + Messages
Bizzworxx: AppGiniHelper + Inline Detail View
Alejandro Landini: To-Do List + MPI + TV Field Editor
Other: Udemy Course
Plugins: Mass Update + Search Page Maker + Summary Reports + Calendar + Messages
Bizzworxx: AppGiniHelper + Inline Detail View
Alejandro Landini: To-Do List + MPI + TV Field Editor
Other: Udemy Course
Re: Click on one of rows and show detail view in modal or pop-up window for add/edit
I have found a work around for the moment (requires changes to template.tv) but still hope someone can provide a quicker code solution!.
For the required popup modal I do not need add/edit functions to the modal template.dv - I just want it to open as modal instead of separate template.dv page for showing information
Cheers, Ron
For the required popup modal I do not need add/edit functions to the modal template.dv - I just want it to open as modal instead of separate template.dv page for showing information
Cheers, Ron
Ron - Gloucestershire, UK: AppGini Pro V 23.15 Rev 1484 - LOVING IT!
Plugins: Mass Update + Search Page Maker + Summary Reports + Calendar + Messages
Bizzworxx: AppGiniHelper + Inline Detail View
Alejandro Landini: To-Do List + MPI + TV Field Editor
Other: Udemy Course
Plugins: Mass Update + Search Page Maker + Summary Reports + Calendar + Messages
Bizzworxx: AppGiniHelper + Inline Detail View
Alejandro Landini: To-Do List + MPI + TV Field Editor
Other: Udemy Course
Re: Click on one of rows and show detail view in modal or pop-up window for add/edit
I know this is a very late reply, but better late than never
Here is a fix that doesn't involve modifying generated files -- you should add the following code to
If you're placing the above code in
Here is a fix that doesn't involve modifying generated files -- you should add the following code to
hooks/footer-extras.php
if you want to apply it to all tables, or to hooks/tablename-tv.js
if you want to apply it only to a specific table:Code: Select all
<script>
$j(function() {
$j('td > a').attr('onclick', '').click(function(e) {
e.preventDefault();
var link = $j(this).attr('href') + '&Embedded=1'; // add '&dvprint_x=1' to show non-editable DV
modal_window({
url: link,
size: 'full',
noAnimation: true,
title: 'Detail view', /* change that to the desired modal window title */
close: function() {
if(confirm('Would you like to reload the table to see changes made in the record?')) location.reload();
}
});
})
})</script>
hooks/tablename-tv.js
, please remove the <script>
and the </script>
lines. AppGini plugins to add more power to your apps:
- DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
- Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
- Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.