Hello fellow creators! I have problems with extending BaseSectionV2 schema. I want to disable View button , so I created a replacing module of BaseSectionV2 and wrote some code, but it's not working. Any advice would be much appreciated
define("BaseSectionV2",[],function(){ return { entitySchemaName:"Base", details:/**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/, attributes:{}, methods:{ checkIsAdmin:function() { var user = Terrasoft.SysValue.CURRENT_USER; var name = user.displayValue; if(name==='Supervisor') return true; return false; } }, diff:/**SCHEMA_DIFF*/[ { "operation": "merge", "name": "AnalyticsModeViewOptionsButton", "parentName": "AnalyticsModeActionButtonsRightContainer", "propertyName": "items", "values": { "itemType": Terrasoft.ViewItemType.BUTTON, "caption": { "bindTo": "Resources.Strings.ViewOptionsButtonCaption"}, "enabled": { "bindTo": "checkIsAdmin"}, } } ]/**SCHEMA_DIFF*/ }; });
File attachments
Like
2 comments
Best reply
09:49 Jan 23, 2023
Hi,
You need to override shema BaseDataView and modify the button SeparateModeViewOptionsButton:
define("BaseDataView",[],function(){ return { details:/**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/, attributes:{}, methods:{ checkIsAdmin:function() { var user = Terrasoft.SysValue.CURRENT_USER; var name = user.displayValue; if(name==='Supervisor') return true; return false; } }, diff:/**SCHEMA_DIFF*/[ { "operation": "merge", "name": "SeparateModeViewOptionsButton", "values": { "enabled": { "bindTo": "checkIsAdmin"} } } ]/**SCHEMA_DIFF*/ }; });
09:49 Jan 23, 2023
Hi,
You need to override shema BaseDataView and modify the button SeparateModeViewOptionsButton:
define("BaseDataView",[],function(){ return { details:/**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/, attributes:{}, methods:{ checkIsAdmin:function() { var user = Terrasoft.SysValue.CURRENT_USER; var name = user.displayValue; if(name==='Supervisor') return true; return false; } }, diff:/**SCHEMA_DIFF*/[ { "operation": "merge", "name": "SeparateModeViewOptionsButton", "values": { "enabled": { "bindTo": "checkIsAdmin"} } } ]/**SCHEMA_DIFF*/ }; });
Show all comments