Adding custom page at end
- kevinvdheuvel
- Posts: 96
- Joined: Mon Mar 09, 2015 3:31 pm
Adding custom page at end
Hi
We would like to add the last page to our export file where we would like to display some use full information to the customer.
we tried to add that HTML content to footer but due to some space issue, the content will be splitting into two page.
we want a dedicated last page to provide some useful information to our customer
like : Do we have any options?
We would like to add the last page to our export file where we would like to display some use full information to the customer.
we tried to add that HTML content to footer but due to some space issue, the content will be splitting into two page.
we want a dedicated last page to provide some useful information to our customer
like : Do we have any options?
- Maxim Gorkovsky
- Core Developer
- Posts: 3307
- Joined: Wed Jan 08, 2014 11:46 am
Re: Adding custom page at end
Hello.
There is a protected method you can override: Sch.plugin.AbstractExporter#onPagesExtracted. Try smth like this:
There is a protected method you can override: Sch.plugin.AbstractExporter#onPagesExtracted. Try smth like this:
Code: Select all
Ext.define(null, {
override: 'Sch.plugin.AbstractExporter',
onPagesExtracted: function (pages) {
pages.push({
html: 'you html goes here',
number: ++me.numberOfPages
});
this.callParent(arguments);
}
})
- kevinvdheuvel
- Posts: 96
- Joined: Mon Mar 09, 2015 3:31 pm
Re: Adding custom page at end
Hi
How can we register this new custom exporter to print plugin?
From API, we found this method registerExporter , but when/how do we call that method?
How can we register this new custom exporter to print plugin?
From API, we found this method registerExporter , but when/how do we call that method?
- Maxim Gorkovsky
- Core Developer
- Posts: 3307
- Joined: Wed Jan 08, 2014 11:46 am
Re: Adding custom page at end
This particular code snippet is an override, if you load it before instantiating scheduler you will get it working.
Assuming you want to use a proper way, you need to register exporter indeed. You can specify exportes in plugin config:
This should do the trick.
Assuming you want to use a proper way, you need to register exporter indeed. You can specify exportes in plugin config:
Code: Select all
Ext.define('MyExporter', {
extend: 'Sch.plugin.exporter.MultiPage' // do not use abstract exporter here, it is too abstract
onPagesExtracted: function () {...}
});
new Sch.panel.SchedulerGrid({
plugins: [{
ptype: 'scheduler_export',
exporters: ['MyExporter'] // don't forget to require class properly
}]
})
- Maxim Gorkovsky
- Core Developer
- Posts: 3307
- Joined: Wed Jan 08, 2014 11:46 am
Re: Adding custom page at end
Speaking of method you mentioned, registerExporter, it can be called in any point of time after plugin was instantiated and before you start export (or export dialog is shown). But providing config should be simplier