Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

#

Attribute

Description

Sample Value

1

enabled

True: Renders the panel page content to the layout.
False: Does not render any panel page.

true

2

swipeEnabled

True: Enables swipe feature for the panel page configuration.
False: Disables the swipe feature for the panel page configuration.

true

3

component

Component is a .JS file that holds the content of the panelPage. Component must be registered in the CLCR registry in the component.js file.
The customized new component can either contain templates with AJAX classes or DOM coding that contains references to images or any workspace etc.

CARDMASTER


Example:
In the following screenshot, the panel that displays the list of workspaces is the Panel Page.


Component code:

Code Block
languageactionscript3
panelPage : {
enabled : true,
swipeEnabled : true,
component: 'utkarsh-MENUMASTER'



Panel Page code:

Code Block
languageactionscript3
canvas.ns('canvas.applnlayout.utkarsh.menumaster');
canvas.applnlayout.utkarsh.menumaster = Class(canvas.core.Component, {
constructor: function(config) {
var that = this;
this.parentElem = config.parentElem;
this.appContainerEle = config.elem;
this.appContainer = config.appContainer;
this.uData = config.uData;
this.itemList = wsArr = canvas.workspace.metadata.getWorkspaces();
/**
*Thisloopistosupportmultilingual.ItgetsthevalueoftheString
*correspondingtothevalueofWORKSPACE_DISPLAY_NMinthepropertyfile
*givenintheBUNDLE_KEY.
*/
for (var index = 0; index <this.itemList.length; index++) {
this.itemList[index].ITEM_LABEL = !canvas.isEmpty(CRB.getBundleValue(this.itemList[index].BUNDLE_KEY, this.itemList[index].WORKSPACE_DISPLAY_NM)) ? CRB.getBundleValue(this.itemList[index].BUNDLE_KEY, this.itemList[index].WORKSPACE_DISPLAY_NM) : this.itemList[index].WORKSPACE_DISPLAY_NM;
}
},
/**
*@methodgetHeaderDOM
*@memberof"canvas.applnlayout.landingpage"
*@descriptionThismethodisresponsibleforloadingtheuserpicture,user
*info,lastlogintimewiththetemplate(cardheader.cttpl).
*/
getLandingDOM: function() {
/**
*Thelistofworkspacesispassedtothetemplatefile(cardmaster.cttpl)
*andmakesacallbacktoapplyTemplate.
*/
var tmpLayer = canvas.templateManager.createTemplate('menumaster.cttpl', this.itemList,canvas.util.getTemplatePath());
tmpLayer.getTemplate(this.applyTemplate, this);
},
/**
*@methodapplyTemplate
*@paramtemplate
*@paramtmpClass
*@descriptionThismethodgetsthetemplate,appendsittotheparent
*elementandaddsclicklistenertoswitchworkspaces.
*/
applyTemplate: function(template, tmpClass) {
if (!canvas.core.isEmpty(this.parentElem)) {
$(this.parentElem).append(template);
} 
//Menu Click
$(this.parentElem).find("[data-itemtype='workspaceid']").on('vclick', function(e) {
var workspaceID = $(this).attr('data-itemid');
//canvas.workspace.metadata.getWorkspaceManager().getContainer().switchWorkspace(workspaceID,null, true);
canvas.HashManager.setHash({
'WORKSPACE_ID': workspaceID 
});
canvas.lib.utility.closeHeaderPopup();
}); 
}
});
CLCR.registerCmp({
"COMPONENT": "utkarsh-MENUMASTER",
"APPLICATION_FW": "JQM"
}, canvas.applnlayout.utkarsh.menumaster); 

...