拉力组合框不会对点击起作用

时间:2017-07-30 14:35:10

标签: javascript html sdk rally

我想创建组合框,列出按名称过滤的所有PortfolioItem / Feature。这是我的代码

        Ext.define('Rally.Dashboard', {
            extend: 'Rally.app.App',
            launch: function () {
                if (this.down('#features')) {
                    this.down('#features').destroy();
                }

                var features = Ext.create('Rally.ui.combobox.ComboBox', {
                    itemId: 'features',
                    allowNoEntry: false,
                    storeConfig: {
                        model: 'PortfolioItem/Feature',
                        fetch: ['FormattedID', 'Name', 'ObjectID', 'UserStories'],
                        autoSelect: true,
                        pageSize: 100,
                        autoLoad: true,
                        filters: [this._getFilter()]
                    },
                    fieldLabel: 'Select Feature',
                    listeners: {
                        ready: function (combobox) {
                            if (combobox.getRecord()) {
                                this._onFeatureSelected(combobox.getRecord());
                            }
                        },
                        select: function (combobox) {
                            if (combobox.getRecord()) {
                                this._onFeatureSelected(combobox.getRecord());
                            }

                        },
                        scope: this
                    }
                });
                this.add(features);

            },
            _onFeatureSelected: function (feature) {

                console.log('feature', feature.get('Name'));


            },//_onFeatureSelected

            _getFilter: function ()
            {
                return {
                    property: 'Name',
                    operator: 'Contains',
                    value: 'Feature'
                }
            }

        });
        Rally.launchApp('Rally.Dashboard', {
            name: 'example'
        });

首次加载仪表板时,一切正常。但是当我点击组合框时,组合框将被清理,并在日志中显示响应错误

" QueryResult":{"错误":["无法解析:找不到属性\" _refObjectName \" on查询段中的类型PortfolioItems" _refObjectName \""]," TotalResultCount":0," StartIndex":0," PageSize":0,"结果":[]}}

1 个答案:

答案 0 :(得分:0)

啊,组合框。不幸的是,由于产品中有许多不同的用法以及随着时间推移的两个不兼容的ExtJS升级,这个组件的使用寿命很长。

我建议使用一个非常好的神器搜索组合框,因为我认为它可以为你处理一堆奇怪的事情(包括预先搜索):

{{1}}