Page 1 of 1

Appgini 5.50 beta master/detail print

Posted: 2015-11-18 15:46
by tuxor
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?

Re: Appgini 5.50 beta master/detail print

Posted: 2015-11-19 05:42
by a.gneady
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.

Re: Appgini 5.50 beta master/detail print

Posted: 2015-11-20 21:11
by tuxor
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

Re: Appgini 5.50 beta master/detail print

Posted: 2015-11-20 21:24
by tuxor
One more thing, how can hide the button to show the children table?

Re: Appgini 5.50 beta master/detail print

Posted: 2015-11-20 21:32
by tuxor
here are the pictures
print button acttion
action_button_print.png
action_button_print.png (98.61 KiB) Viewed 5373 times
hide children table button
Seleccion_003.png
hide button children table
Seleccion_003.png (45.23 KiB) Viewed 5373 times