この例を使用して extjs5 の使用方法を学習し、単純なグリッドパネルを作成していますが、うまくいきません (例では を使用しています。renderTo: Ext.getBody()
この部分をrenderTo: 'example-grid'
の内部に表示するように変更しました<div id="example-grid">
が、div は空を示しています。コードは次のとおりです。
<head>
<html:base />
<title><bean:write name="UserFormBean" property="Nombre"/></title>
<link rel="stylesheet" href="../../../../config/ext-theme-classic/build/resources/ext-theme-classic-all.css" type="text/css" />
<link rel="stylesheet" href="../../../../config/ext-theme-classic/build/resources/ext-theme-classic-all-debug.css" type="text/css" />
<script src="../../../../config/js/ExtLocale/<%=request.getSession(true).getAttribute( "langSesion")%>"></script>
<script type="text/javascript" src="../../../../config/ext-theme-classic/build/ext-theme-classic.js"></script>
<script type="text/javascript" src="../../../../config/ext-theme-classic/build/ext-theme-classic-debug.js"></script>
<script type="text/javascript" src="../../../../config/js/ext-all-5.0.js"></script>
<script type="text/javascript" src="../../../../config/js/ext-all-debug-5.0.js"></script>
<script type="text/javascript">
Ext.onReady(function() {
//MODEL
Ext.define('User', {
extend: 'Ext.data.Model',
fields: [ 'name', 'email', 'phone' ]
});
// DATASTORE
var userStore = Ext.create('Ext.data.Store', {
model: 'User',
data: [
{ name: 'Lisa', email: 'lisa@simpsons.com', phone: '555-111-1224' },
{ name: 'Bart', email: 'bart@simpsons.com', phone: '555-222-1234' },
{ name: 'Homer', email: 'homer@simpsons.com', phone: '555-222-1244' },
{ name: 'Marge', email: 'marge@simpsons.com', phone: '555-222-1254' }
]
});
//GRIDPANEL
Ext.create('Ext.grid.Panel', {
renderTo: 'example-grid',
store: userStore,
width: 400,
height: 200,
title: 'Application Users',
columns: [
{
text: 'Name',
width: 100,
sortable: false,
hideable: false,
dataIndex: 'name'
},
{
text: 'Email Address',
width: 150,
dataIndex: 'email',
hidden: true
},
{
text: 'Phone Number',
flex: 1,
dataIndex: 'phone'
}
]
});
}
</script>
</head>
<body>
<div id="example-grid"></div>