navipnr
13 Sep 2010, 1:56 AM
Hi,
I am getting an runtime error when i executing this page. Please help me to solve this
I am attaching the code
................
<html>
<head>
<title> Data View Test 2 </title>
<!-- ExtJS library: base/adapter -->
<script type="text/javascript" src="../../adapter/ext/ext-base-debug.js"></script>
<!-- ExtJS library: all widgets -->
<script type="text/javascript" src="../../ext-all-debug.js"></script>
<script type="text/javascript">
Ext.onReady(function() {
var arrayData = [
['Jay Garcia', 'MD'],
['Aaron Baker', 'VA'],
['Susan Smith', 'DC'],
['Mary Stein', 'DE'],
['Bryan Shanley','NJ'],
['Nyri Selgado', 'CA']
];
var nameRecord = Ext.data.Record.create([
{ name : 'name', mapping : 0 },
{ name : 'state', mapping : 1 }
]);
var arrayReader = new Ext.data.ArrayReader({}, nameRecord);
var memoryProxy = new Ext.data.MemoryProxy(arrayData);
var store = new Ext.data.Store({
reader : arrayReader,
proxy : memoryProxy
});
store.load();
var dataview = new Ext.DataView({
store: store,
tpl : new Ext.XTemplate(
'<ul>',
'<tpl for=".">',
'<li >',
'<strong>{name}</strong>',
'</li>',
'</tpl>',
'</ul>'
),
singleSelect: true,
multiSelect : true,
autoScroll : true
});
dataview.render(document.body);
});
</script>
</head>
<body >
This is an example of data view
</body>
</html>
I am getting an runtime error when i executing this page. Please help me to solve this
I am attaching the code
................
<html>
<head>
<title> Data View Test 2 </title>
<!-- ExtJS library: base/adapter -->
<script type="text/javascript" src="../../adapter/ext/ext-base-debug.js"></script>
<!-- ExtJS library: all widgets -->
<script type="text/javascript" src="../../ext-all-debug.js"></script>
<script type="text/javascript">
Ext.onReady(function() {
var arrayData = [
['Jay Garcia', 'MD'],
['Aaron Baker', 'VA'],
['Susan Smith', 'DC'],
['Mary Stein', 'DE'],
['Bryan Shanley','NJ'],
['Nyri Selgado', 'CA']
];
var nameRecord = Ext.data.Record.create([
{ name : 'name', mapping : 0 },
{ name : 'state', mapping : 1 }
]);
var arrayReader = new Ext.data.ArrayReader({}, nameRecord);
var memoryProxy = new Ext.data.MemoryProxy(arrayData);
var store = new Ext.data.Store({
reader : arrayReader,
proxy : memoryProxy
});
store.load();
var dataview = new Ext.DataView({
store: store,
tpl : new Ext.XTemplate(
'<ul>',
'<tpl for=".">',
'<li >',
'<strong>{name}</strong>',
'</li>',
'</tpl>',
'</ul>'
),
singleSelect: true,
multiSelect : true,
autoScroll : true
});
dataview.render(document.body);
});
</script>
</head>
<body >
This is an example of data view
</body>
</html>