Appgini 5.50 beta master/detail print

Wish to see a specific feature/change in future releases? Feel free to post it here, and if it gets enough "likes", we'd definitely include it in future releases!
Post Reply
tuxor
Veteran Member
Posts: 48
Joined: 2014-06-15 00:09

Appgini 5.50 beta master/detail print

Post by tuxor » 2015-11-18 15:46

Hi, i'm testing the new release and it's great. Now I have some questions:

1-How to enable the detail print automatically?, don't click on the button with the name of the table, just appear the register of the detail table.
2-how to change the print template (size sheet, location of the fields, size of the ) for master and detail print? where files need to edit?
3-Finally, how to print in the selected printed (in the messsage dialog) and just not to show the preview of the print when click in print preview?

User avatar
a.gneady
Site Admin
Posts: 1281
Joined: 2012-09-27 14:46
Contact:

Re: Appgini 5.50 beta master/detail print

Post by a.gneady » 2015-11-19 05:42

1. In hooks/footer-extras.php, try adding this code:

Code: Select all

<script>
	$j(function(){
		$j(document).ajaxComplete(function(){
			var btn = $j('button#tab_tablename-fieldname');
			
			if(btn.data('run_once')) return;
			btn.data('run_once', true).click();
		});
	});
</script>
Change tablename and fieldname above to the name of the child table, and the lookup field, respectively.

2. the templates/tablename_templateDVP.html is the main printable detail view template file for a table named 'tablename'. templates/children-tablename-printable.php is the template file for displaying printable child records from a child table named 'tablename'.

3. I'm not sure I understand this part "how to print in the selected printed (in the messsage dialog)" .. kindly clarify.
:idea: 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.

tuxor
Veteran Member
Posts: 48
Joined: 2014-06-15 00:09

Re: Appgini 5.50 beta master/detail print

Post by tuxor » 2015-11-20 21:11

thanks for answer.

1.- the print enabled works with only one table (detalle_compras), but if I have 2 or more tables with children/parent print, don't shows automatically the child table. I need to click in the button. I added the code you gave to me, please check:

Code: Select all

<script>
   $j(function(){
      $j(document).ajaxComplete(function(){
         var btn = $j('button#tab_DETALLE_COMPRAS-ID_COMPRA');
         
         if(btn.data('run_once')) return;
         btn.data('run_once', true).click();
      });
   });
</script>

<script>
   $j(function(){
      $j(document).ajaxComplete(function(){
         var btn = $j('button#tab_DETALLE_VENTAS-ID_VENTA');
         
         if(btn.data('run_once')) return;
         btn.data('run_once', true).click();
      });
   });
</script>
3.-check the picture I send to understand what I say.

Thanks

tuxor
Veteran Member
Posts: 48
Joined: 2014-06-15 00:09

Re: Appgini 5.50 beta master/detail print

Post by tuxor » 2015-11-20 21:24

One more thing, how can hide the button to show the children table?

tuxor
Veteran Member
Posts: 48
Joined: 2014-06-15 00:09

Re: Appgini 5.50 beta master/detail print

Post by tuxor » 2015-11-20 21:32

here are the pictures
print button acttion
action_button_print.png
action_button_print.png (98.61 KiB) Viewed 4370 times
hide children table button
Seleccion_003.png
hide button children table
Seleccion_003.png (45.23 KiB) Viewed 4370 times

Post Reply