Sencha EXTJS Panel Demo
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<!-- ExtJS -->
<link rel="stylesheet" type="text/css" href="ext-4.1/resources/css/clifton-blue.css" />
<script type="text/javascript" src="/ext-4.1/ext-all.js"></script>
<script type="text/javascript" src="/ext-4.1/locale/ext-lang-ko.js" charset="utf-8" />
<!-- Shared -->
<link rel="stylesheet" type="text/css" href="/ext-4.1/shared/example.css" />
<link rel="stylesheet" type="text/css" href="/css/project.css" />
<script type="text/javascript" src="/Panel.js"></script>
</head>
<body>
</body>
</html>
Panel.js
Ext.onReady(function(){
Ext.tip.QuickTipManager.init();
var store = Ext.create('Ext.data.Store', {
storeId:'simpsonsStore',
fields:['name', 'email', 'phone'],
data:{'items':[
{ 'name': 'Lisa', "email":"lisa@simpsons.com", "phone":"555-111-1224" },
{ 'name': 'Bart', "email":"bart@simpsons.com", "phone":"555-222-1234" },
{ 'name': 'Homer', "email":"home@simpsons.com", "phone":"555-222-1244" },
{ 'name': 'Marge', "email":"marge@simpsons.com", "phone":"555-222-1254" }
]},
proxy: {
type: 'memory',
reader: {
type: 'json',
root: 'items'
}
}
});
new Ext.Component({
autoScroll:true,
renderTo: document.body,
html: 'DOM ready!'
});
var mainPanel = Ext.create('Ext.panel.Panel', {
bodyStyle: "background-image:url(/images/Opera-Background-Blue-Swirls.jpg)",
//width: 900,
//height: 600,
autoScroll:true,
frame:true,
//resizable:true,
frameHeader:true,
// headerPosition:'left',
title: 'Container Panel 한글헤더',
html:'html code here',
items: [
/*
{
xtype: 'panel',
title: 'Child Panel 1',
frame:true,
frameHeader:true,
headerPosition:'left',
height: 200,
width: '100%'
},
*/
{
xtype: 'panel',
title: 'Child Panel 2',
height: 200,
width: '100%',
bodyStyle: "background-image:url(
/images/pictures-of-beautiful-roses-14.jpg)",
layout: {
type: 'hbox',
align: 'stretch'
},
items:[
{
xtype: 'panel',
title: 'child sub 1',
height: 50,
width: '50%',
headerPosition:'left',
margin: '5 5 5 5'
},
{
xtype: 'panel',
title: 'child sub 2',
height: 50,
width: '50%',
headerPosition: 'bottom',
flex: 10
}
]
},
{
xtype: 'grid',
title: 'Simpsons',
store: Ext.data.StoreManager.lookup('simpsonsStore'),
columns: [
{ text: 'Name', dataIndex: 'name' },
{ text: 'Email', dataIndex: 'email', flex: 1 },
{ text: 'Phone', dataIndex: 'phone' }
],
height: 200,
width: 400
}
],
listeners: {
}
});
var viewPort = Ext.create('Ext.container.Viewport',{
title:'viewport',
bodyStyle: "background-image:url(/demo/images/Opera-Background-Blue-Swirls.jpg)",
width: '95%',
autoScroll:true,
renderTo: Ext.getBody(),
items: [mainPanel]
});
var circlePanel = Ext.create('Ext.panel.Panel',{
title: 'Circle',
height : 200,
frame:true,
resizable:false,
frameHeader:true,
html:'<br><br><br><br><br><img src="/demo/images/gear.png" width=50, height=50, class="circle1" id="circle" >'
});
console.log(circlePanel.id);
mainPanel.add(circlePanel);
var floatingPanel = Ext.create('Ext.panel.Panel',{
// title : 'floating Panel ',
// width : 600,
// height : 200,
frame : false,
floating : true,
html : '<iframe src="http://www.dailymotion.com/embed/video/xxawgk?logo=0&autoPlay=1&start=" width=820 height=600 frameborder=0 scrolling=no marginheight=0 marginwidth=0></iframe>'
});
var floatingButton = Ext.create('Ext.Button', {
text: 'Click me Floating Panel',
width : 500,
enableToggle: true,
toggleHandler : function (button,state){
console.log (button , state);
if (state){
floatingPanel.show();
this.setText('Click Me disable FloatingPanel hide!');
} else {
floatingPanel.hide();
this.setText('Click Me enable FloatingPaenl show');
}
}
});
mainPanel.add(floatingButton);
var circle = Ext.get('circle');
console.log(circle);
circle.syncFx();
circle.animate({
duration : 600000,
to: {
x: Ext.getBody().getWidth(),
opacity: 0
}
});
});
댓글
댓글 쓰기
질문이나 의견은 요기에 남겨주세요 ^^,,