【问题标题】:How do I change two multiviews simultaneously?如何同时更改两个多视图?
【发布时间】:2014-07-06 18:52:56
【问题描述】:

好的,让我首先解释一下我所拥有的。

我有一个分段控件作为我的标签栏控件。这会根据选择的段(选项卡)更改页面的内容。 页面内容分为左右两列。每列都有自己的多视图。

现在问题出现在我只能在更改段(选项卡)时更改其中一个多视图。

 _______________
|  ___ ___ ___  |
| (_1_|_2_|_3_) |  /* segments or tabs */
|   ____ _____  |
|  |left|right| |  /* two columns that must change */
|  |~~~ |~~~  | |
|  |~~~ |~~~  | |
|  |~~~ |     | |
|  |____|_____| |
|_______________|

这是我的一些代码,我正在使用 dhtmlx touch

{
container:"content",
type:"clean",
css:"page",
rows:[
    {
        view:"toolbar",
        elements:[
            {view:"segmented", width:320, inputWidth: 280, multiview: true, selected:"cos_301", align:"center", options: [   
                { label: 'COS 301', value: "cos_301"},
                { label: 'COS 333', value: "cos_333"},
                { label: 'COS 364', value: "cos_364"}
            ]}
        ]
    },
    {cols:[
        {view:"label", label:"Announcements"},
        {view:"label", label:"Pracs"}
    ]},
    {cols:[
        {view:"multiview", width:200, height: 290, 
            cells:[    
                { template:"some info", scrol: true, id:"cos_301" },
                { template:"some info", scrol: true, id:"cos_333" },
                { template:"some info", scroll: true, id:"cos_364" }
            ]
        },
        {view:"multiview", width:100, height: 290, 
            cells:[    
                { template:"some info", scrol: true, id:"cos_301p" },
                    { template:"some info", scrol: true, id:"cos_333p" },
                    { template:"some info", scrol: true, id:"cos_364p" }
                ]}
    ]}
    ]
}

/这显示正确,只是不想改变/

【问题讨论】:

    标签: tabbar dhtmlx multiview multiviews


    【解决方案1】:

    您可以尝试设置 onBeforeTabClick 处理程序以在标签点击时显示多个视图(在这种情况下,您可以从配置中删除“multiview: true”):

    dhx.ui({
    ...
    {view:"segmented", id: "tabs", ...}
    ...
    });
    
    $$("tabs").attachEvent("onBeforeTabClick", function(button, id) {
       // show the view in the first column
       $$(id).show();
       // and the second column
       $$(id+"p").show();
       return true;
    });
    

    【讨论】:

    • 分段控件没有 onBeforeTabClick 事件。而且我已经尝试过 onBeforeRender 事件,但这似乎不起作用。我不知道我正在使用“dhtmlx touch”这一事实是否与我的挣扎有关。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-06-24
    • 1970-01-01
    • 1970-01-01
    • 2018-04-29
    • 1970-01-01
    • 2018-12-23
    • 2015-09-01
    相关资源
    最近更新 更多