首页 新闻 会员 周边

ext js 存在的问题

0
[待解决问题]

 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>HCMM | 硬件开发项目管理平台</title>
    <link href="Resources/ext/resources/css/ext-all.css" rel="stylesheet" type="text/css" />
    <link href="Resources/css/app-portal.css" rel="stylesheet" type="text/css" />
    <script src="Resources/js/jquery-1.3.2.js" type="text/javascript"></script>
    <script src="Resources/ext/adapter/jquery/ext-jquery-adapter.js" type="text/javascript"></script>
    <script src="Resources/ext/ext-all.js" type="text/javascript"></script>
    <script type="text/javascript">
        Ext.BLANK_IMAGE_URL = 'Resources/ext/resources/images/default/s.gif';
    </script>
    <script type="text/javascript" src="Resources/js/TabCloseMenu.js"></script>
    <script type="text/javascript" src="Resources/js/AppPortal.js"></script>
    <script type="text/javascript" src="Resources/js/MainPanel.1.js"></script>
    <script type="text/javascript" src="Resources/js/LeftPanel.js"></script>
    <script type="text/javascript">
        Portal = {};
        var goUrl = '';
        var tabUrl = '';
        var admin = '';
        var pageTitle = '';
        Ext.onReady(function() {

            if (goUrl != '') {
                if (pageTitle == '') {
                    pageTitle = goUrl;
                }
                AppPortal.mainPanel.loadLink({ href: goUrl, text: pageTitle });
            }
            if (tabUrl != '') {
                if (pageTitle == '') {
                    pageTitle = tabUrl;
                }
                AppPortal.mainPanel.openTab({ href: tabUrl, text: pageTitle });
            }
        });
    </script>
    <script type="text/javascript" src="MenuData.aspx"> </script>
</head>

问题补充: AppPortal = {}; Ext.onReady(function() { Ext.QuickTips.init(); Ext.state.Manager.setProvider(new Ext.state.CookieProvider()); var tpl = Ext.Template.from('preview-tpl', { compiled: true, getBody: function(v, all) { return Ext.util.Format.stripScripts(v || all.description); } }); AppPortal.getTemplate = function() { return tpl; } var menus = new LeftPanel(); //var mainPanel = new MainPanel(); AppPortal.mainPanel = new MainPanel(); menus.on('menuselect', function(menu) { var link = { href: menu.href, text: menu.text, loaded: true }; AppPortal.mainPanel.loadLink(link); }); var viewport = new Ext.Viewport({ layout: 'border', items: [ new Ext.BoxComponent({ // raw element region: 'north', el: 'north-div', height: 62 }), menus, AppPortal.mainPanel, new Ext.BoxComponent({ // raw element region: 'south', el: 'south-div', //collapsible: true, margins: '0 0 0 10', height: 20 }) ] }); Ext.get('header').on('click', function() { viewport.focus(); }); menus.focus(); }); AppPortal.LinkInterceptor = { render: function(p) { p.body.on({ 'mousedown': function(e, t) { // try to intercept the easy way _blank t.target = '_self'; }, 'click': function(e, t) { // if they tab + enter a link, need to do it old fashioned way if (String(t.target).toLowerCase() != '_self') { e.stopEvent(); window.open(t.href); } }, delegate: 'a'
yangyueming的主页 yangyueming | 初学一级 | 园豆:2
提问于:2010-10-11 14:05
< >
分享
所有回答(2)
0

你想干什么?出什么错误?贴段代码在这里?

悠悠思丶 | 园豆:189 (初学一级) | 2010-10-11 14:07
我在做一个ext 的框架,但openTab不能实现
支持(0) 反对(0) yangyueming | 园豆:2 (初学一级) | 2010-10-11 14:08
<body> <div id="north-div"> <!--<div style="float:right;margin:5px;" class="x-small-editor"></div>--> <div id="header" style="width: 100%; padding: 0px; background-color: White"> <!--<a href="#" style="float:right;margin-right:10px;"> <img src="resources/extjs.gif" style="width:83px;height:24px;margin-top:1px;"/></a>--> <div style="margin: 0px"> <img src="Resources/img/Login/bg0002.jpg" style="margin: 0px; height: 30px;" /></div> </div> <span style="float: left; margin: 5px 0px 0px 5px;">欢迎&nbsp;&nbsp;<b><%=UserID %></b>&nbsp;&nbsp;<%=DateTime.Now.ToShortDateString() %>&nbsp;&nbsp; </span><span id="aLoginOut" style="float: right; margin: 5px 5px 0px 0px"><a onclick="if (!window.confirm('您确认要注消当前登录用户吗?')){return false;}" href="logout.aspx">注销</a></span> </div> <!-- Template used for menu Items --> <div id="preview-tpl" style="display: none;"> <%--<div class="post-data"> <span class="post-date">{StartTime:date("M j, Y, g:i a")}</span> <h3 class="post-title"> {Name}</h3> <h4 class="post-author"> by {PDTManager:defaultValue("Unknown")}</h4> </div> <div class="post-body"> {Description:this.getBody}</div>--%> </div> <div id="south-div"> <div> <p> H3C
支持(0) 反对(0) yangyueming | 园豆:2 (初学一级) | 2010-10-11 14:24
protected void Page_Load(object sender, EventArgs e) { Response.Clear(); WiteMenuJS(); Response.End(); } private void WiteMenuJS() { Response.Write(@"Portal.navData = [ { text : '项目信息', href : 'HardwareProject/ProjectList.aspx', hrefTarget : 'center-iframe', leaf : true } , { text : '问题及风险', href : 'ProjectIssue/ProjectIssueIndex.aspx?ProjectType=Issue', hrefTarget : 'center-iframe', leaf : true } , { text : '重计划/裁剪与偏差', href : 'HardwareProject/ProjectList.aspx?ProjectType=Replan', hrefTarget : 'center-iframe', leaf : true } , { text : '项目周报', href : 'ProjectReport/ProjectReportIndex.aspx', hrefTarget : 'center-iframe', leaf : true } , { text : '项目度量', href : 'ProjectMetricsSheet/MetricsSheetExcel.aspx', hrefTarget : 'center-iframe', leaf : true }"); if (WebUtility.IsSystemAdmin()) { Response.Write(@", { text : '系统管理', expanded : true, children : [ { text : '系统常量', href : 'BasicData/Constant.aspx', hrefTarget : 'center-iframe', leaf : true } , { text : '项目模板', href : 'ProjectConfiguration/ProjectConfiguration.aspx', hrefTarget : 'center-iframe', leaf : true }, { text: '系统缓存刷新管理', href: 'BasicData/CacheManagement.aspx',hrefTarget: 'center-iframe', leaf: true } ] }"); } Response.Write("]; "); }
支持(0) 反对(0) yangyueming | 园豆:2 (初学一级) | 2010-10-11 14:25
function getFrameHTML(url) { var id = Ext.id(); var html = '<div><iframe id="' + id + '" width="750px" src="'; html = html + url ; html = html + '" height="400px" name="' + id + '" rel="external" frameborder="0" scrolling="auto" style="border:0px none; background-color:#BBBBBB; " ></iframe></div>'; return html; } //type区分问题风险 //up区分更改类型 //IssueId更改Id function Issue(up,typeurl,IssueId,SindBoardId,flowId) { var url = typeurl + "?IssueOperation=" + up + "&SindBoardId=" + SindBoardId + "&IssueId=" + IssueId + "&FlowId=" + flowId; OpenWindow(url,"项目问题风险设置"); } function OpenWindow(url, title, item) { var win2 = new Ext.Window({ layout: 'fit', title: title, width: 730, height: 400, maximizable: true, closeAction: 'hide', plain: true, items: new Ext.Panel({ html: getFrameHTML(url), border: false }), buttons: [{ text: '返回', handler: function() { win2.close(); } }] }); win2.show(item); }
支持(0) 反对(0) yangyueming | 园豆:2 (初学一级) | 2010-10-15 09:06
<script src="../Resources/js/jquery-1.3.2.js" type="text/javascript"></script> <script src="../Resources/ext/adapter/jquery/ext-jquery-adapter.js" type="text/javascript"></script> <script src="../Resources/ext/ext-all.js" type="text/javascript"></script>
支持(0) 反对(0) yangyueming | 园豆:2 (初学一级) | 2010-10-15 10:49
0

最烦的就是这样帖段代码,下面没了

钧梓昊逑 | 园豆:945 (小虾三级) | 2010-10-11 19:39
function getAppPortal(win) { if (win == undefined || win == null) { win = window; } if (win.AppPortal != undefined) { return win.AppPortal; } if (win.parent != win && win.parent != null) { return getAppPortal(win.parent); } return null; } function openTab(url, title) { var portal = getAppPortal(); if (portal != null && portal.mainPanel != undefined) { var link = { href: url, text: title }; portal.mainPanel.openTab(link); } else { window.open(url); } } function closeTab(tabId) { var portal = getAppPortal(); if (portal != null && portal.mainPanel != undefined) { portal.mainPanel.closeTab(tabId); } else { window.close(); } } function getCurrTabId() { var portal = getAppPortal(); if (portal != null && portal.mainPanel != undefined) { return portal.mainPanel.activeTab.id; } else { return null; } } function getCurrTab() { var portal = getAppPortal(); if (portal != null && portal.mainPanel != undefined) { return portal.mainPanel.activeTab; } else { return null; } } function initCalendars() { $(".DateField").each(function(i, textField) { var dateField = new Ext.form.DateField({ allowBlank: true, format: 'Y-m-d', applyTo: textField }); }); }
支持(0) 反对(0) yangyueming | 园豆:2 (初学一级) | 2010-11-24 16:48
MainPanel = function() { this.preview = new Ext.Panel({ id: 'preview', region: 'south', cls: 'preview', autoScroll: true, listeners: AppPortal.LinkInterceptor, tbar: [{ id: 'tab', text: '在新Tab页中打开', iconCls: 'new-tab', disabled: true, handler: this.openTab, scope: this }], clear: function() { this.body.update(''); var items = this.topToolbar.items; items.get('tab').disable(); //items.get('win').disable(); } }); MainPanel.superclass.constructor.call(this, { id: 'main-tabs', activeTab: 0, region: 'center', margins: '0 5 5 0', resizeTabs: true, tabWidth: 150, minTabWidth: 120, enableTabScroll: true, plugins: new Ext.ux.TabCloseMenu(), items: { id: 'main-view', layout: 'border', title: '我的任务', hideMode: 'display', items: [ { region: 'center', html: '<iframe id="center-iframe" width="100%" src="home.aspx" height=100% name="center-iframe" rel="external" frameborder="0" scrolling="auto" style="border:0px none;margin:0px 3px 3px 0px; background-color:#BBBBBB; " ></iframe>' }, //this.grid, { id: 'bottom-preview', layout: 'fit', collapsible: true, items: this.preview, height: 250, split: true, border: false, region: 'south', hidden: true }, {
支持(0) 反对(0) yangyueming | 园豆:2 (初学一级) | 2010-11-26 10:08
}] } }); this.mainView = Ext.getCmp('main-view'); }; Ext.extend(MainPanel, Ext.TabPanel, { loadLink: function(link) { if (link.loaded == undefined || link.loaded != true) { var centerIframe = Ext.getDom("center-iframe"); centerIframe.src = link.href; //this.centerIframe.src = link.href; } this.mainView.setTitle(link.text); this.setActiveTab(this.mainView); }, movePreview: function(m, pressed) { if (!m) { // cycle if not a menu item click var items = Ext.menu.MenuMgr.get('reading-menu').items.items; var b = items[0], r = items[1], h = items[2]; if (b.checked) { r.setChecked(true); } else if (r.checked) { h.setChecked(true); } else if (h.checked) { b.setChecked(true); } return; } if (pressed) { var preview = this.preview; var right = Ext.getCmp('right-preview'); var bot = Ext.getCmp('bottom-preview'); var btn = this.grid.getTopToolbar().items.get(2); switch (m.text) { case 'Bottom': right.hide(); bot.add(preview); bot.show(); bot.ownerCt.doLayout(); btn.setIconClass('preview-bottom'); break; case 'Right': bot.hide(); right.add(preview); right.show(); right.ownerCt.doLayout(); btn.setIconClass('preview-right'); break; cas
支持(0) 反对(0) yangyueming | 园豆:2 (初学一级) | 2010-11-29 17:38
html = html + link.href; html = html + '" height=100% name="iframe' + id + '" frameborder="0" scrolling="auto" style="border:0px none;" ></iframe>'; if (!(tab = this.getItem(id))) { tab = new Ext.Panel({ id: id, cls: 'preview single-preview', title: link.text, tabTip: tabTip, html: html, closable: true, listeners: AppPortal.LinkInterceptor, autoScroll: true, border: true }); this.add(tab); } this.setActiveTab(tab); }, closeTab: function closeTab(tabId) { var currTab = this.getItem(tabId); this.remove(currTab); } }); Ext.reg('appmainpanel', MainPanel);
支持(0) 反对(0) yangyueming | 园豆:2 (初学一级) | 2010-11-29 17:39
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册