
To add a page navigation for a myaccount menu tab
view file
define('JJ.myaccountvi.myaccountvimodule.View'
, [
'jj_myaccountvi_myaccountvimodule.tpl'
, 'Backbone'
]
, function (
jj_myaccountvi_myaccountvimodule_tpl
//, myaccountvimoduleSS2Model
, Backbone
)
{
'use strict';
// @class JJ.myaccountvi.myaccountvimodule.View @extends Backbone.View
return Backbone.View.extend({
template: jj_myaccountvi_myaccountvimodule_tpl
, initialize: function (options) {
}
, events: {
}
, bindings: {
}
, childViews: {
}
//@method getContext @return JJ.myaccountvi.myaccountvimodule.View.Context
, getContext: function getContext()
{
//@class JJ.myaccountvi.myaccountvimodule.View.Context
this.message = this.message || 'Hello World!!'
return {
message: this.message
};
}
});
});
Entry file
define(
'JJ.myaccountvi.myaccountvimodule'
, [
'JJ.myaccountvi.myaccountvimodule.View'
,'JJ.myaccountvi.myaccountvimodule.Router'
]
, function (
myaccountvimoduleView
,myaccountrouter
)
{
'use strict';
return {
mountToApp: function mountToApp (container)
{
/** @type {LayoutComponent} */
var myaccountmenu = container.getComponent("MyAccountMenu");
var preordersmenugroup = {
id: "Downloads",
name: "Customer Notification",
index: 6,
url: "update-terms-and-conditions",
permissionoperator: "OR",
permission: [
{
group: "transactions",
id: "tranSalesOrd",
level: "1"
},
{
group: "transactions",
id: "tranEstimate",
level: "1"
}
]
}
myaccountmenu.addGroup(preordersmenugroup);
return new myaccountrouter(container);
}
};
});
create a router file
define('JJ.accountvi.accountvimodule.Router'
, [
'Backbone'
, 'JJ.accountvi.accountvimodule.View'
]
, function
(
Backbone
, myaccountvimoduleView
)
{
'use strict';
return Backbone.Router.extend({
routes:
{
'update-terms-and-conditions': 'termsView'
}
, initialize: function (container)
{
this.application = container;
this.UserProfile = container.getComponent('UserProfile');
}
, termsView: function ()
{
var self = this;
this.UserProfile.getUserProfile().then(function (profileData)
{
var view = new myaccountvimoduleView
({
application: self.application
, UserProfile: profileData
})
view.showContent();
});
}
})
});