ucan-ext-js-kitchen-sink
Version:
my-ext-gen-app description for Ext JS app MyExtGenApp
52 lines (49 loc) • 1.25 kB
JavaScript
Ext.define('UCAN.reviewPanel.src.review', {
extend: 'Ext.dataview.Component',
xtype: 'ucanreview',
config: {
reviewObject: null
},
twoWayBindable: {
reviewObject: true
},
itemsFocusable: false,
itemConfig: {
xtype: 'container',
layout: 'hbox',
viewModel: true,
items: [
{
xtype: 'ucanLabel',
bind: {
translationKey: '{record.name}',
cls: '{record.ko ? "ucan-review-label-name" : ""}'
},
updateTranslationKey: function(config) {
const translatedKey = this.up('ucanreviewpanel').getTranslator().get(config);
if (Ext.isEmpty(translatedKey)) {
this.setHtml(config);
} else {
this.setHtml(translatedKey)
}
}
},
{
xtype: 'spacer'
},
{
xtype: 'ucanreviewentry',
bind: {
entry: '{record}'
}
}
]
},
updateReviewObject: function(config) {
this.setStore(config.get('reviewEntries'));
this.query('ucanreviewentry').forEach(entry => entry.setDisabled(this.getDisabled()));
},
updateDisabled: function(config) {
this.query('ucanreviewentry').forEach(entry => entry.setDisabled(config));
}
});