Dojo:根据url参数选择加载的选项卡 [英] Dojo: Select a tab on load depending on url parameter

查看:99
本文介绍了Dojo:根据url参数选择加载的选项卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



有没有办法在加载时选择标签容器中的标签,这取决于url参数?我尝试过以下操作,但似乎没有发生我想要的标签未被选择:

  dojo.addOnLoad(function(){
tabToSelect = getParameter( );
if(tabToSelect){
dijit.byId(container)。selectChild(tabToSelect);}}

我有控制台注销了参数,我知道这是正确的。



我有一个强烈的感觉,我错过了一些东西..

解决方案

对于那些可能有同样问题的人,我得到了dojo邮件列表的答案,必须通过实际选项卡而不是一个字符串,如下所示:

 

var tab = tabToSelect && dijit。 byId(tabToSelect);
if(tab){dijit.byId(container)。selectChild(tab)};

现在就像一个魅力一样!


Is there a way to select a tab in a tab container upon load depending on a url parameter?

I have tried the following but nothing seems to happen and the tab I want is not selected:

dojo.addOnLoad(function() {
tabToSelect = getParameter("tab");
if(tabToSelect){
    dijit.byId("container").selectChild(tabToSelect); } }

I have console logged out the parameter and I know it is correct.

I have a strong feeling I am missing something....

解决方案

For those that might have the same question, I got the answer off the dojo mailing list, have to pass the actual tab instead of just a string, as follows:


    var tab = tabToSelect && dijit.byId(tabToSelect);
    if(tab){ dijit.byId("container").selectChild(tab)};

Works like a charm now!

这篇关于Dojo:根据url参数选择加载的选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆