widget base: props: add a list of dynamic props that don't need any action when changed to take effect
This commit is contained in:
parent
1e7d13c279
commit
d00eedc5f8
1 changed files with 5 additions and 0 deletions
|
|
@ -27,6 +27,7 @@ module.exports = class _widgets_base extends EventEmitter {
|
|||
this.container = options.container || fallbackContainer
|
||||
this.widget = DOM.create(options.html)
|
||||
this.props = options.props
|
||||
this.dynamicProps = []
|
||||
this.parent = options.root ? widgetManager : options.parent
|
||||
this.parentNode = options.parentNode
|
||||
this.hash = shortid.generate()
|
||||
|
|
@ -324,12 +325,16 @@ module.exports = class _widgets_base extends EventEmitter {
|
|||
|
||||
onPropChanged(propName, options) {
|
||||
|
||||
if (this.dynamicProps.indexOf(propName) != -1) return
|
||||
|
||||
switch(propName) {
|
||||
|
||||
case 'value':
|
||||
this.setValue(this.getProp('value'), {sync:true, send: options && options.send})
|
||||
return
|
||||
|
||||
|
||||
|
||||
default:
|
||||
this.reCreateWidget()
|
||||
return true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue