Yes it does. The article outlines adding the code to filter the list of printables to both the section (for section records and also when opened in combined mode) and the page as well for when a record is opened in edit mode.
Yes it does. The article outlines adding the code to filter the list of printables to both the section (for section records and also when opened in combined mode) and the page as well for when a record is opened in edit mode.
I tried the code that you suggested for both section and edit page and it is working fine for the edit page. However, for the section page, the filteration is not working and it is showing the complete list of printables available for the section.
Please find the code below for section page filteration:
Filteration is to be done for the lookup : "UsrDocumentRepositorySubtype"
methods:{// since we'll be determining if the printable is viewable// based on the Type column, we need to make sure that column// is available in the section list query
initQueryColumns: function(esq){this.callParent(arguments);if(!esq.columns.contains("UsrDocumentRepositorySubtype")){
esq.addColumn("UsrDocumentRepositorySubtype");}},
// now we need to wire up the Visible property of each menu item// to our own function where we'll check the type column and return// whether or not the printable should be shown
initCardPrintForms: function(){this.callParent(arguments);
var printMenuItems =this.get(this.moduleCardPrintFormsCollectionName);if(Ext.isEmpty(printMenuItems))return;
printMenuItems.each(function(item){
item.set("Visible", {bindTo:"getPrintMenuItemVisible"});}, this);},
// this is the function will determine if a printable is visible// it is called for each printable and will return true/false to show or hide
getPrintMenuItemVisible: function(reportId){if(Ext.isEmpty(this.get("ActiveRow")))returntrue;
var type =this.get("GridData").get(this.get("ActiveRow")).get("UsrDocumentRepositorySubtype")||{ displayName:""},
printMenuItems =this.get(this.moduleCardPrintFormsCollectionName),
item = printMenuItems.find(reportId);if(Ext.isEmpty(item))return;switch(item.get("Caption")){case"Mining and Quarrying Questionnaire":return type.displayValue==="Mining and Quarrying Questionnaire";case"Alcohol Questionnaire":return type.displayValue==="Alcohol Questionnaire";default:returntrue;}}}