Extjs5 tabs实例

<%@ page language= "java" contentType ="text/html; charset=UTF-8"

pageEncoding="UTF-8" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd" >

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title> OCS对接</title >

<script src="../../../resources/ext5/ext-all.js" ></script>

<script src="../../../resources/ext5/packages/ext-locale/ext-locale-zh_CN.js" ></script>

<link href="../../../resources/ext5/packages/ext-theme-access/build/resources/ext-theme-access-all.css" rel="stylesheet" />

<!-- example code -->

<link rel="stylesheet" type="text/css" href="../../../resources/ext5/warnConfig.css" >

<script src="../../../resources/ext5/treefilter.js"></script >

<script type="text/javascript" >

//

// This is the main layout definition.

//

//

// Note that these are all defined as panel configs, rather than instantiated

// as panel objects.  You could just as easily do this instead:

//

// var absolute = Ext.create(‘Ext.Panel‘, { ... });

//

// However, by passing configs into the main container instead of objects, we can defer

// layout AND object instantiation until absolutely needed.  Since most of these panels

// won‘t be shown by default until requested, this will save us some processing

// time up front when initially rendering the page.

//

// Since all of these configs are being added into a layout container, they are

// automatically assumed to be panel configs, and so the xtype of ‘panel‘ is

// implicit.  To define a config of some other type of component to be added into

// the layout, simply provide the appropriate xtype config explicitly.

//

function getBasicLayouts() {

// This is a fake CardLayout navigation function.  A real implementation would

// likely be more sophisticated, with logic to validate navigation flow.  It will

// be assigned next as the handling function for the buttons in the CardLayout example.

var cardNav = function(incr){

var l = Ext.getCmp(‘card-wizard-panel‘ ).getLayout();

var i = l.activeItem.id.split(‘card-‘ )[1];

var next = parseInt(i, 10) + incr;

l.setActiveItem(next);

//   Ext.getCmp(‘card-prev‘).setDisabled(next===0);

//   Ext.getCmp(‘card-next‘).setDisabled(next===2);

};

return {

/*

* ================  Start page config  =======================

*/

// The default start page, also a simple example of a FitLayout.

start: {

id: ‘mainPanel‘,

title: ‘OCS系统点号对接配置‘ ,

layout: ‘fit‘,

bodyPadding: 25

}

};

}

Ext.onReady(function(){

Ext.tip.QuickTipManager.init();

var detailsCmp;

// Gets all layouts examples

/*

var layoutExamples = [];

Ext.Object.each(getBasicLayouts(), function(name, example) {

layoutExamples.push(example);

});

*/

//     Ext.Object.each(getCombinationLayouts(), function(name, example){

//         layoutExamples.push(example);

//     });

//     Ext.Object.each(getCustomLayouts(), function(name, example){

//         layoutExamples.push(example);

//     });

// This is the main content center region that will contain each example layout panel.

// It will be implemented as a CardLayout since it will contain multiple panels with

// only one being visible at any given time.

<%--    var contentPanel = {--%>

<%--        id: ‘content-panel‘,--%>

<%--    //    region: ‘border‘, // this is what makes this panel into a region within the containing layout--%>

<%--        margins: ‘2 5 5 0‘,--%>

<%--        fit:true,--%>

<%--        activeItem: 0,--%>

<%--        border: false,--%>

<%--        items: layoutExamples--%>

<%--    };--%>

var store = Ext.create( ‘Ext.data.TreeStore‘, {

root: {

expanded: true,

text: "My Root",

children: [

{ text: "Child 1", leaf: true },

{ text: "Child 2", expanded: true, children: [

{ text: "GrandChild", leaf: true }

] }

]

}

/*

proxy: {

actionMethods: {

create: "POST", read: "POST", update: "POST", destroy: "POST"

},

type: ‘ajax‘,

autoLoad : true,

noCache: false,

//   url: ‘${pageContext.request.contextPath}/sysLoginAction/getTreeAction_ext.action‘,

extraParams:{pid:‘1‘}

}

*/

});

// Go ahead and create the TreePanel now so that we can use it below

var tab1 = Ext.create( ‘MyTreePanel‘, {

id: ‘tab1‘,

title: ‘tab1‘,

region: ‘center‘,

split: true,

height: 360,

minSize: 150,

rootVisible: false,

autoScroll: true,

store: store

});

var tab2 = Ext.create( ‘MyTreePanel‘, {

id: ‘tab2‘,

title: ‘tab2‘,

region: ‘center‘,

split: true,

height: 360,

minSize: 150,

rootVisible: false,

autoScroll: true

});

/*

treePanel.getSelectionModel().on(‘select‘, function(selModel, record) {

if (record.get(‘leaf‘)) {

//            Ext.getCmp(‘content-panel‘).layout.setActiveItem(record.getId() + ‘-panel‘);

//

//            detailsCmp = Ext.getCmp(‘details-panel‘);

//            detailsCmp.body.hide().slideIn(‘l‘, {stopAnimation:true,duration: 200});

//            detailsCmp.update(Ext.getDom(record.getId() + ‘-details‘).innerHTML);

//            detailsCmp.doLayout();

}

});

*/

// This is the Details panel that contains the description for each example layout.

var tabs = Ext.widget(‘tabpanel‘ , {

resizeTabs: true,

enableTabScroll: true,

items: [tab1,tab2]

});

<%--{--%>

<%--    id: ‘tabsPanel‘,--%>

<%--    region: ‘center‘, // this is what makes this panel into a region within the containing layout--%>

<%--    border: false,--%>

<%--    layout: ‘fit‘ ,--%>

<%--    items:tabs--%>

<%--//tabs为tab页,在items中增加fit即可--%>

<%--  //  height:500,--%>

<%--    //bodyStyle: ‘background:#fff;‘ --%>

<%--}--%>

var detailsPanel = {

id: ‘main‘,

region: ‘center‘,

title: ‘Details‘,

border: false,

layout: ‘fit‘ ,

items:tabs

};

// Finally, build the main layout once all the pieces are ready.  This is also a good

// example of putting together a full-screen BorderLayout within a Viewport.

Ext.create(‘Ext.Viewport‘, {

layout: ‘border‘,

title: ‘Ext Layout Browser‘,

items: [

detailsPanel

]

});

<%--    var field = Ext.get(‘textfieldid‘);  --%>

<%--          field.on(‘keyup‘, function(e) {  --%>

<%--              //  alert(Ext.getCmp(‘textfieldid‘).getValue());--%>

<%--                treePanel.filterByText(Ext.getCmp(‘textfieldid‘).getValue()) ; --%>

<%--             });  --%>

});

</script>

</head>

<body>

</body>

</html>

时间: 2024-10-01 14:05:16

Extjs5 tabs实例的相关文章

easyui中layout、accordion加tabs实现简单菜单布局实例

一般对于后台界面都是采用BorderLayout进行布局的.BorderLayout也就是将界面分成五块,如下图所示,分别有:North.East.South.West.Center 其中比较特殊的是Center这块区域,它是不固定的,会随着四块区域的变化而做出相应的调整.比如将West向左缩小10px,那么Center则会向West方向扩张10px.其实这个easyUI已经帮我们实现好了,我们只需要使用它的layout就可以完成. <body class="easyui-layout&q

[ExtJS5学习笔记]第十一节 Extjs5MVVM模式下系统登录实例

本文地址: 本文作者:sushengmiyan ------------------------------------------------------------------------------------------------------------------------------------ 暂时完成效果图如下: 1.登录界面 输入任意用户名与密码(暂时没有设置登录验证等,后期添加),点击用户登录进入主页面 在左下角,显示了你刚才输入的用户名,实现了数据的传输. 代码模块展示

JQuery 学习总结及实例 !! (转载)

出自 new:http://www.jianshu.com/users/1967b163cb61/latest_articles 1.JQuery简介 普通JavaScript的缺点:每种控件的操作方式不统一,不同浏览器下有区别,要编写跨浏览器的程序非常麻烦.因此出现了很多对JavaScript的封装库,比如Prototype.Dojo.ExtJS.JQuery等,这些库对JavaScript进行了封装,简化了开发.这些库是对JavaScript的封装,也就是咱们调用JQuery的一句函数,JQ

插件实例修改2

这个是根据前面一篇项目作出修改,那个增加的页面都是列表页面 配置文件 1 <?xml version="1.0" encoding="UTF-8"?> 2 <xp-web> 3 <modules> 4 <!-- 第三方APP服务端 --> 5 <module path="/web/plugins/bs/yygl/bz/extapp" form="" scope="

插件实例修改3

根据我前2篇项目,又做了更新,把3tab页面合成一个页面,主要用到easyui 页面布局 配置文件 1 <?xml version="1.0" encoding="UTF-8"?> 2 <xp-web> 3 <modules> 4 <!-- 第三方APP服务端 --> 5 <module path="/web/plugins/bs/yygl/bz/extapp" form="&quo

插件实例修改

前端框架是easyui框架,后台的框架是我们公司自己写的.做的功能主要是插件修改,使用easyui iframe, tab,datagrid组件 配置文件 <?xml version="1.0" encoding="UTF-8"?> <xp-web> <modules> <!-- 第三方APP服务端 --> <module path="/web/plugins/bs/yygl/bz/extapp&quo

插件实例修改4

在插件实例修改3增加一个联系人功能 配置文件 1 <?xml version="1.0" encoding="UTF-8"?> 2 <xp-web> 3 <modules> 4 <!-- 第三方APP服务端 --> 5 <module path="/web/plugins/bs/yygl/bz/extapp" form="" scope="request"

跟我一起学extjs5(03--项目中文件的加载过程)

跟我一起学extjs5(03--项目中文件的加载过程) 上一节中用sencha工具自动创建了一个项目,并且可以在浏览器中查看.现在我们来看看js类加载过程.如下图所示: 1?首先:浏览器中输入 localhost:1841 ,调用 index.html; <!DOCTYPE HTML> <html> <head> <meta charset="UTF-8"> <title>app</title> <!-- T

跟我一起学extjs5(04--MVVM特性的简单说明)

跟我一起学extjs5(04--MVVM特性的简单说明) 下面我们来看一下自动生成的代码中的MVVM架构的关系.Main是一个可视的控件,MainController是这个控件的控制类,MainModel是这个控件的模型类. 在上面的图片中,左边是Main.js中的代码,右边是MainController.js 和 MainModel.js中的代码,可以看到MVVM中的事件绑定和属性值绑定都用到了.上图中红色的部分标注了一个按钮"Button"的handler(即click)事件绑定到