0
Tabview :YUI 3 나는이 방법에 의해 tabview를 만들었습니다 액세스
var tabview;
var Y = YUI({ insertBefore: 'my_css' });
Y.use('tabview', function (Y) {
tabview = new Y.TabView({
children: [{
label: 'Suche',
content: "<div id=\"tab1\"> </div>"
}, {
label: 'Objekt-Liste',
content: "<div id=\"tab2\"> </div>"
}, {
label: 'Objekt-Detail',
content: "<div id=\"tab3\"> </div>"
}]
});
tabview.item(1).disable().on('selectedChange', function() {
if (boolTab1) {
return true;
} else {
return false;
}
});
tabview.item(2).disable().on('selectedChange', function() {
if (boolTab2) {
return true;
} else {
return false;
}
});
tabview.render('#tabs');
});
지금은 외부에서 내 tabview 개체에 액세스하고 싶습니다. 예 : 로드시이 함수는 다음과 같이 호출됩니다.
function init() {
tabview.deselectAll();
tabview.selectChild(0);
this.name = "";
this.value = "";
boolTab1 = false;
boolTab2 = false;
tabview.item(1).disable();
tabview.item(2).disable();
requestSuche(this);
}
따라서 FF로 완벽하게 작동합니다. 그러나 테스트 한 다른 모든 브라우저는 init() 함수의 tabview 객체에 대해 알지 못합니다. 흥미로운 점; 파이어 폭스에서 그것은 또한 상단에있는 'var tabview'를 제거 할 때 작동합니다. 내 다른 js 함수에서 내 탭보기에 올바르게 액세스하려면 어떻게해야합니까?