Hide some rows on printing

Community plugins and extensions
Post Reply
User avatar
simplecode
Posts: 5
Joined: Wed Oct 30, 2019 1:17 pm

Hide some rows on printing

Post by simplecode »

Hi!
I need to exclude empty rows in Ext Gantt when call print().
Trying to implement eventRenderer method, but cannot find out what to set or what to return to hide row.

User avatar
mats
Core Developer
Core Developer
Posts: 16407
Joined: Sat Dec 19, 2009 11:41 pm
Location: Sweden
Contact:

Re: Hide some rows on printing

Post by mats »

Simply filter your task store before you call print.
Tired of debugging javascript errors in web applications? Try our new error logging service RootCause, or read more on the Sencha blog

@bryntum
Facebook
API documentation

User avatar
simplecode
Posts: 5
Joined: Wed Oct 30, 2019 1:17 pm

Re: Hide some rows on printing

Post by simplecode »

Thank mats, it worked!
Another problem I met with printing again: I want to hide Gantt view (right part) when printing. I am using

Code: Select all

beforePrint : function(sched) {
  sched.normalGrid.hide();
  --method to increase left view width to the whole page
} 

I see that changes are applied to my Gantt panel but by printing it restores view with Gantt diagram without changes.

User avatar
pmiklashevich
Core Developer
Core Developer
Posts: 2996
Joined: Fri Apr 01, 2016 11:08 am

Re: Hide some rows on printing

Post by pmiklashevich »

Hiding normal grid is not supported by Sencha. But you can workaround it like:

Code: Select all

var w = Ext.first('ganttpanel').lockedGrid.getWidth();
// hide
Ext.first('ganttpanel').lockedGrid.setWidth('100%');
// show
Ext.first('ganttpanel').lockedGrid.setWidth(w);
Please see my response here: viewtopic.php?f=49&t=10699#p57832
Pavel Miklashevich - Core Developer

Post Reply