【问题标题】:Creating user story popover创建用户故事弹出框
【发布时间】:2015-09-01 19:56:31
【问题描述】:

有人可以帮我创建一个出现在鼠标悬停时的弹出框,以显示用户故事名称和它所属的项目。我在拉力赛中创建了一个自定义应用程序,以网格形式显示父子故事。当用户将鼠标悬停在子故事 ID 上以查看名称和项目信息时,我想创建一个弹出框。如何添加此功能?

this.grid = this.down('#gridCnt').add({
    xtype: 'rallygrid',
    id: 'dataGrid',
    showPagingToolbar: true,
    flex: 1,
    store: myCustomStore,
    plugins: ['rallyboardformattedidhoverable'],
    enableBlockedReasonPopover: false,
    columnCfgs: [{
            xtype: 'templatecolumn',
            text: 'ID',
            dataIndex: 'FormattedID',
            width: 80,
            tpl: Ext.create('Rally.ui.renderer.template.FormattedIDTemplate')
        }, {
            text: 'Name',
            dataIndex: 'Name',
        },
        {
            text: 'Child stories',
            dataIndex: 'Children',
            flex: 1,
            renderer: function(value) {
                var html = [];
                Ext.Array.each(value, function(child) {
                    html.push('<a href="' + Rally.nav.Manager.getDetailUrl(child) + '">' + child.FormattedID + '</a>' + ' - ' + child.Project);
                });
                return html.join('</br>');
            }
        }, 

【问题讨论】:

    标签: rally


    【解决方案1】:

    有一个插件可以完全满足您的需求。只需将插件添加到您的网格配置中:

    plugins: ['rallyboardformattedidhoverable'],
    getRecord: function(x) {
        return this.view.getRecord(x);
    },
    

    【讨论】:

    • 嗨凯尔,感谢您的回复。我在网格配置中添加了插件,但它不起作用。
    • 你是对的——它抛出了一个错误。我在上面的 sn-p 中添加了一个 getRecord 函数,现在应该可以为您工作了。我对此行为提出了缺陷。
    • 谢谢凯尔!它仍然抛出错误“Uncaught TypeError: b.record.isSearch is not a functiona.define.bake @ sdk.js:11a.define._showPopover @ sdk.js:11c @ sdk.js:4”
    • 嗯。该插件必须假定您在商店中的模型以某种方式从 Rally.data.wsapi.Model 扩展。您可以添加一个函数 isSearch() 只返回 false 给您的模型,或者让您的模型从故事模型扩展。否则看起来你可能不得不从头开始编写插件/弹出窗口......
    猜你喜欢
    • 1970-01-01
    • 2013-02-08
    • 1970-01-01
    • 2014-09-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-06-22
    相关资源
    最近更新 更多