LearnNewsExamplesServices
Frontmatter
id1736
titlecontroller.Component: add support for string based listeners when dynamically adding components
stateClosed
labels
enhancement
assigneestobiu
createdAtApr 8, 2021, 4:51 PM
updatedAtApr 13, 2021, 4:30 PM
githubUrlhttps://github.com/neomjs/neo/issues/1736
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtApr 13, 2021, 4:30 PM

controller.Component: add support for string based listeners when dynamically adding components

Closed v8.1.0 enhancement
tobiu
tobiu commented on Apr 8, 2021, 4:51 PM

Right now, the model.Component implementation is a bit more advanced.

Inside Neo.examples.model.advanced.MainContainerController we have the method:

    onAddButtonTextfieldButtonClick(data) {
        let me = this;

        me.getReference('content-container').insert(2, {
            items: [{
                ntype     : 'textfield',
                flex      : 'none',
                labelText : 'data.button2Text:',
                labelWidth: 150,
                width     : 300,

                bind: {
                    value: '${data.button3Text}'
                },

                listeners: {
                    change: me.onTextField3Change,
                    scope : me
                }
            }]
        });
    }

It would be nice if we can optionally specify it the same way as inside the MainContainer view as well:

    onAddButtonTextfieldButtonClick(data) {
        let me = this;

        me.getReference('content-container').insert(2, {
            items: [{
                ntype     : 'textfield',
                flex      : 'none',
                labelText : 'data.button2Text:',
                labelWidth: 150,
                width     : 300,

                bind: {
                    value: '${data.button3Text}'
                },

                listeners: {
                    change: 'onTextField3Change'
                }
            }]
        });
    }
tobiu added the enhancement label on Apr 8, 2021, 4:51 PM
tobiu assigned to @tobiu on Apr 8, 2021, 4:51 PM
tobiu
tobiu Apr 13, 2021, 4:30 PM

already resolved by #1757.

tobiu closed this issue on Apr 13, 2021, 4:30 PM