How to add a Search Bar to a Nested List?

こ雲淡風輕ζ 提交于 2019-12-25 01:24:03

问题


How can I create a Nested List with a search bar, which should be located under the title. For instance, on the fourth Sencha Nested List example, how would I insert a Search Bar (code below) so that it looks like this image:

Sencha Example

Example Search Bar:

Ext.define('Sencha.view.SearchBar', {
    extend: 'Ext.Toolbar',
    xtype : 'searchbar',
    requires: ['Ext.field.Text', 'Ext.field.Search'],

    config: {
        ui: 'searchbar',
        layout: 'vbox',

        items: [
            {
                xtype: 'title',
                title: 'Search'
            },
            {
                xtype: 'searchfield',
                placeHolder: 'Search...'
            }
        ]
    }
});

回答1:


You'll need to add it after the Nested List has been instantiated, so the docking position is correct.

var nestedList = Ext.create('Ext.NestedList', {
    ...
});

nestedList.add({
    docked: 'top',
    xtype: 'searchbar',
    height: 100
});


来源:https://stackoverflow.com/questions/10235735/how-to-add-a-search-bar-to-a-nested-list

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!