Advertisement
christiansalazarh

Para convertir un TAG A en un lanzador POP de impresion

Jan 19th, 2013
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.52 KB | None | 0 0
  1. <?php
  2. Yii::app()->getClientScript()->registerScript(
  3. "script_id",
  4. "
  5.     $.fn.activatePdfViewerLinks = function(selectorName){
  6.         $(selectorName).each(function(){
  7.             var a = $(this);
  8.             a.css('cursor','pointer');
  9.             a.attr('alt',a.attr('href'));
  10.             a.attr('href',null);
  11.             a.click(function(){
  12.                 var href = $(this).attr('alt');
  13.                 var w = window.open(href,'pdf-viewer',
  14.                     'width=800,menubar=1');
  15.                 w.print();
  16.             });
  17.         });
  18.     }
  19.  
  20.     $.fn.activatePdfViewerLinks('.trans-doc-pdf-viewer');
  21. ",CClientScript::POS_LOAD);
  22. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement