0

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

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

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

 _______________
|  ___ ___ ___  |
| (_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" }
                ]}
    ]}
    ]
}

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

4

1 回答 1

0

您可以尝试设置 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;
});
于 2014-05-19T14:52:33.510 回答