Skip to content

Instantly share code, notes, and snippets.

@pphetra
Created June 29, 2013 03:11
Show Gist options
  • Select an option

  • Save pphetra/5889543 to your computer and use it in GitHub Desktop.

Select an option

Save pphetra/5889543 to your computer and use it in GitHub Desktop.
<html>
<head>
<title>Template</title>
<link rel="stylesheet" href="extjs/resources/css/ext-all.css">
<script src="extjs/ext-all-debug.js"></script>
<script>
// รอให้ page load เสร้จแล้วค่อยทำงาน
Ext.onReady(function() {
Ext.create('Ext.panel.Panel', {
height: 200,
renderTo: document.body,
layout: {
type: 'table',
columns: 3
},
defaults: {
width: 40,
xtype: 'button'
},
listeners: {
click: function(btn, e) {
var key = btn.getText();
alert('clicked ' + key);
}
},
items: [
{
xtype: 'textfield',
colspan: 3,
width: 120
},
{
text: '7',
bubbleEvents: ['click']
},
{
text: '8'
},
{
text: '9'
},,
{
text: '4'
},
{
text: '5'
},
{
text: '6'
},
{
text: '1'
},
{
text: '2'
},
{
text: '3'
},
{
text: '0'
},
{
text: 'clr'
}
]
})
});
</script>
</head>
<body>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment