Внешние ссылки в Ext.TabPanel
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title> My Map </title> <script type="text/javascript" src="http://extjs.cachefly.net/ext-3.2.1/adapter/ext/ext-base.js"></script> <script type="text/javascript" src="http://extjs.cachefly.net/ext-3.2.1/ext-all.js"></script> <link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-3.2.1/resources/css/ext-all.css"/> <link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-3.2.1/resources/css/xtheme-gray.css" /> <link rel="stylesheet" href="http://dev.openlayers.org/releases/OpenLayers-2.9.1/theme/default/style.css" type="text/css" /> <link rel="stylesheet" href="../../../resources/app/theme/style.css" type="text/css" /> <script src="http://dev.openlayers.org/releases/OpenLayers-2.9.1/OpenLayers.js"></script> <script src="http://api.geoext.org/0.7/script/GeoExt.js"></script> <script type="text/javascript"> Ext.BLANK_IMAGE_URL = "http://extjs.cachefly.net/ext-3.2.1/resources/images/default/s.gif"; OpenLayers.ImgPath = "http://dev.openlayers.org/releases/OpenLayers-2.9.1/img/"; Ext.onReady(function(){ var tabs = new Ext.TabPanel({ // renderTo: Ext.getBody(), renderTo: "tabs", // renderTo: document.body, // autoHeight: true, // height: 1000, // width: 1000, enableTabScroll: true, // fullscreen: true, // activeItem: 1, // border : false, activeTab: 0, // plain: true, // deferredRender:false, // defaults:{autoScroll: true, autoHeight: true, autoWidth: true}, items: [ { title: 'Просмотр информации', autoLoad:{url: "tab1.htm", scripts: true}, listeners:{ activate : function(tabpanel){ tabpanel.getUpdater().refresh(); } } },{ title: 'Редактирование', autoLoad:{url: "tab2.htm", scripts: true}, listeners:{ activate : function(tabpanel){ tabpanel.getUpdater().refresh(); } } } ] }); }); </script> </head> <body> <div id="tabs"></div> </body> </html> tab1.htm, tab2.htm - отдельные странички с картографической инфой. открывает нормально, но если перейти на другой tab или добавить новый слой на карту, то вылетает ошибка "Cannot read property 'dom' of null". Далее попробовал убрать из htm-ок все кроме скриптов(tab#.js), оставил <scripts>все это</scripts>, стало все работать без ошибок, но не переключает вкладки, как будто не обновляется страница(вкладка), так как при перетаскивании панелей начинает появляться новая вкладка. |
Смотрите в фаербаге номер строчки, на которой идет ошибка. Возможно у вас идет обращение к DOM элементу, а его там нет.
|
Часовой пояс GMT +3, время: 23:28. |