Code:
define('custom:views/modals/my-dialog', ['views/modal', 'model'], (ModalView, Model) => {
return class extends ModalView {
className = 'dialog dialog-record'
// language=Handlebars
templateContent = `
<div class="record no-side-margin">{{{record}}}</div>
`;
// If true, clicking on the backdrop will close the dialog.
// Can be 'static', true or false.
backdrop = true
async setup() {
// Action buttons
this.buttonList = [{
name: 'doSomething', // handler for 'doSomething' action is below
text: this.translate('Some Action', 'labels', 'MyScope'), // button label
style: 'danger',
onClick: () => this.foo(),
},
{
name: 'cancel',
label: 'Cancel',
},
];
const title = 'Distribute Leads'; // assuming it's passed from our parent view
this.headerText = title;
this.formModel = new Model();
// Define fields
this.formModel.setDefs({
fields: {
'someString': {
type: 'varchar', // field type
view: 'views/fields/varchar', // optional, to define custom view
required: true, // field param
},
'someCheckbox': {
type: 'bool',
},
}
});
// Load the collection asynchronously before initializing the list view
const collection = await this.loadCollection();
console.log('Collection => ', collection)
this.createView('record', 'views/record/list', {
collection: collection,
type: 'listSmall',
},
async loadCollection() {
const collection = await this.getCollectionFactory().create('User');
await collection.fetch();
return collection;
}
async foo() {
//some function
}
}
});​
The createView does not create my list in the parent view is there something im missing, maybe a metadata/clientDefs declaration​

Comment