Matthew Martin
02/16/2023, 8:34 PMBryce Krah
02/16/2023, 8:41 PM{{#each yourData}} <span>name</span> {{/each}}
which is how its done with handlebars in the templates where yourData is set on the view's getContextMatthew Martin
02/16/2023, 8:48 PMyourData
to a function in a SuiteScript?Bryce Krah
02/16/2023, 8:55 PMMatthew Martin
02/16/2023, 8:55 PMMatthew Martin
02/20/2023, 9:47 PMMatthew Martin
02/20/2023, 9:47 PMBryce Krah
02/20/2023, 10:03 PMinitialize: function () {
this.model = new YourCustomModelToFetchNS();
},
beforeShowContent: function () {
return this.model.fetch();
},
getContext: function getContext() {
return {
something: this.model.get('something')
};
}
Matthew Martin
02/20/2023, 10:11 PMinitialize: function initialize () {
this.model = new ContractsExtensionPOC3ContractLinesModel();
},
beforeShowContent: function beforeShowContent () {
this.childViews = {
'ContractsExtensionPOC3.ContractLines.Form.View': function () {
return new ContractsExtensionPOC3ContractLinesFormView({
model: this.model
});
}
};
if (!!Number(this.options.routerArguments[0])) {
this.getBreadcrumbPages = function () {
return [
{
text: Utils.translate('Contract Lines'),
href: '/contractlines'
},
{
text: 'Edit'
}
];
};
this.title = Utils.translate('Edit Contract Line');
return this.model.fetch({
data: {internalid: this.options.routerArguments[0]}
});
}
else {
this.getBreadcrumbPages = function () {
return [
{
text: Utils.translate('Contract Lines'),
href: '/contractlines'
},
{
text: 'Add'
}
];
};
this.title = Utils.translate('Add Contract Line');
return jQuery.Deferred().resolve();
}
},
getContext: function getContext () {
return {
isNew: this.model.isNew()
};
},