Print

Can we have the grid’s print view functionality attatched to the browser print button??

In IE you can use onbeforeprint event, which triggers when print button pressed, so it possible to attach custom print functionality call for it.
Unfortunately FF doesn’t provide similar interface.


I tried the following code and its not working. Is this the right way to implement this functionality??



mygrid.attachEvent(“onbeforeprint”,function(){mygrid.printView();});



 

onbeforeprint is native event of browser, not the custom event of component, you can use next code

    window.onbeforeprint=function(){
       mygrid.printView();
       return false;
    });