ucan-ext-js-kitchen-sink
Version:
my-ext-gen-app description for Ext JS app MyExtGenApp
64 lines (60 loc) • 1.44 kB
JavaScript
Ext.define('UCAN.reviewPanel.src.reviewPanel', {
extend: 'Ext.dataview.Component',
xtype: 'ucanreviewpanel',
config: {
templateData: null,
templateStore: null,
oneChecked: false,
allChecked: false,
oneTemplateChecked: false,
schema: null,
translator: null
},
twoWayBindable: {
templateData: true,
templateStore: true,
oneChecked: true,
allChecked: true,
oneTemplateChecked: true,
translator: true
},
itemsFocusable: false,
itemConfig: {
viewModel: true,
xtype: 'container',
items: [
{
xtype: 'ucanLabel',
updateTranslationKey: function(config) {
const translatedKey = this.up('ucanreviewpanel').getTranslator().get(config);
if (Ext.isEmpty(translatedKey)) {
this.setHtml('<h3>' + config + '</h3>');
} else {
this.setHtml('<h3>' + translatedKey + '</h3>')
}
},
bind: {
translationKey: '{record.name}'
}
},
{
xtype: 'spacer'
},
{
xtype: 'ucanreview',
bind: {
reviewObject: '{record}'
}
}
]
},
updateTemplateData: function(config) {
this.setData(config);
},
updateTemplateStore: function(config) {
this.setStore(config);
},
updateDisabled: function(config) {
this.query('ucanreview').forEach(review => review.setDisabled(config));
}
});