we have a detail (Activity) with three editing pages (investigation, corrective actions, preventive actions) for which we must connect the click event of each detail so that the menu is filtered to obtain a specific page for each,
I implemented the code below but still not getting the result.
define("ClaSchema821f5cb2Detail", [], function() {
return {
entitySchemaName: "Activity",
details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,
diff: /**SCHEMA_DIFF*/[
{
"operation": "merge",
"name": "AddTypedRecordButton",
"parentName": "Claims1PageClaSchema821f5cb2Detail2b214db7Container",
"propertyName": "items",
"values": {
"controlConfig": {
"menu": {
"items": {
"bindTo": "EnabledEditPages",
"bindConfig": {
"converter": function(editPages) {
return editPages;
/*if (editPages.getCount() >= 1) {
return editPages;
} else {
return null;
}*/
}
}
}
}
}
}
},
{
"operation": "merge",
"name": "AddTypedRecordButton",
"parentName": "Claims1PageClaSchema821f5cb2Detail682ca645Container",
"propertyName": "items",
"values": {
"controlConfig": {
"menu": {
"items": {
"bindTo": "EnabledEditPages2",
"bindConfig": {
"converter": function(editPages) {
return editPages;
/*if (editPages.getCount() >= 1) {
return editPages;
} else {
return null;
}*/
}
}
}
}
}
}
},
{
"operation": "merge",
"name": "AddTypedRecordButton",
"parentName": "Claims1PageClaSchema821f5cb2Detail8ef4781dContainer",
"propertyName": "items",
"values": {
"controlConfig": {
"menu": {
"items": {
"bindTo": "EnabledEditPages3",
"bindConfig": {
"converter": function(editPages) {
return editPages;
/*if (editPages.getCount() >= 1) {
return editPages;
} else {
return null;
}*/
}
}
}
}
}
}
},
]/**SCHEMA_DIFF*/,
methods: {
initEditPages: function() {
console.log("initEditPagesinitEditPagesinitEditPagesinitEditPages");
var enabledEditPages = new this.Terrasoft.Collection();
var enabledEditPages2 = new this.Terrasoft.Collection();
var enabledEditPages3 = new this.Terrasoft.Collection();
this.callParent(arguments);
var editPages = this.getEditPages();
var items = editPages.getItems();
var item = items.filter(function(item){return item.get("SchemaName") == 'ClaActivityPageV21';});
enabledEditPages.add(item);
this.set("EnabledEditPages", enabledEditPages);
var item2 = items.filter(function(item){return item.get("SchemaName") == 'ClaActivityPageV23';});
enabledEditPages2.add(item2);
this.set("EnabledEditPages2", enabledEditPages2);
var item3 = items.filter(function(item){return item.get("SchemaName") == 'ClaActivityPageV24';});
enabledEditPages3.add(item3);
this.set("EnabledEditPages3", enabledEditPages3);
},
}
};
});