/* * Ext JS Library 1.1.1 * Copyright(c) 2006-2007, Ext JS, LLC. * licensing@extjs.com * * http://www.extjs.com/license */var layout, feedPanel, innerLayout;var grid, ds, sm;var addFeed, currentItem, tpl;var suggested, feeds;var sfeeds, myfeeds;var seed = 0;var Viewer = function(){ // a bunch of private variables accessible by member function // feed clicks bubble up to this universal handler var feedClicked = function(e){ // find the "a" element that was clicked var a = e.getTarget('a'); if(a){ e.preventDefault(); Viewer.loadFeed(a.href); Viewer.changeActiveFeed(a.id.substr(5)); } }; return { init : function(){ // initialize state manager, we will use cookies Ext.state.Manager.setProvider(new Ext.state.CookieProvider()); feeds = Ext.get('feeds'); suggested = Ext.get('suggested'); // delegate clicks on the lists feeds.on('click', feedClicked); suggested.on('click', feedClicked); // create the main layout layout = new Ext.BorderLayout(document.body, { north: { split:false, initialSize: 80, titlebar: false, margins:{top: 0, left: 0, right:0, bottom: 0} }, west: { split:true, initialSize: 170, minSize: 175, maxSize: 400, titlebar: true, collapsible: true, animate: true, autoScroll:false, useShim:true, collapsed:true, cmargins: {top:0,bottom:2,right:2,left:2} }, east: { split:true, initialSize: 170, minSize: 175, maxSize: 400, titlebar: true, collapsible: true, animate: true, autoScroll:false, useShim:true, collapsed:true, cmargins: {top:0,bottom:2,right:2,left:2} }, center: { html:'<hr>', border :false, titlebar: false, autoScroll:true, margins:{top: 0, left: 0, right:0, bottom: 0}, closeOnTab: false, alwaysShowTabs: false, resizeTabs: true } }); // tell the layout not to perform layouts until we're done adding everything layout.beginUpdate(); layout.add('north', new Ext.ContentPanel('header')); // initialize the statusbar //south = layout.getRegion('south'); layout.add('west', new Ext.ContentPanel('feeds', {title: 'Tool Tip', fitToFrame:true})); layout.add('east', new Ext.ContentPanel('suggested', {title: 'My resource', fitToFrame:true})); // // the inner layout houses the grid panel and the preview panel innerLayout = new Ext.BorderLayout('main', { }); feedPanel = new Ext.NestedLayoutPanel(innerLayout); feedPanel.load({ url: "test.htm", discardUrl: false, fitContainer:true, fitToFrame:true, nocache: false, text: "Loading...", timeout: 30, margins:{top: 10, left: 0, right:0, bottom: 0}, scripts: true }); layout.add('center', feedPanel); innerLayout.beginUpdate(); layout.restoreState(); layout.endUpdate(); } };}();Ext.onReady(Viewer.init, Viewer);function changeContent(forwardpage){ feedPanel.setUrl(forwardpage); feedPanel.refresh(); //alert(forwardpage); /* feedPanel.load({ html:'<hr>', url:forwardpage , discardUrl: false, nocache: false, text: "Loading...", timeout: 30, scripts: true }); layout.add('center', feedPanel); innerLayout.beginUpdate(); layout.restoreState(); layout.endUpdate(); */}
ext_panel
最新推荐文章于 2022-03-30 18:57:56 发布