crgrah
19 Mar 2012, 4:36 PM
Hi forum users and the sencha team,
Im having the following problem, this code generates no errors no does it render to
the specified 'LeftPanel', where is it going wrong?
/// <reference path="http://extjs.cachefly.net/ext-4.0.2a/ext-all-debug.js" />
/// <reference path="http://extjs.cachefly.net/ext-4.0.2a/resources/css/ext-all.css" />
Ext.onReady(function () {
// Set up a model
Ext.define('Clients', {
extend: 'Ext.data.Model',
fields: [
{ name: 'firstName', type: 'string' },
{ name: 'lastName', type: 'string' }
]
});
var clientstore = Ext.create('Ext.data.Store', {
autoLoad: true,
model: 'Clients',
sorters: 'firstName',
getGroupString: function (record) {
return record.get('firstName')[0];
},
proxy: {
type: 'ajax',
url: 'data/clients.json',
reader: {
type: 'json',
root: 'users'
}
}
});
var ClientList = new Ext.view.View({
store: clientstore,
itemTpl: '<div class="contact"><strong>{firstName}</strong> {lastName}</div>',
grouped: true,
indexBar: true,
//Columns definition
columns: [
{ dataIndex: 'FirstName' },
{ dataIndex: 'LastName' }
],
//Render grid to dom element with id set to panel
renderTo: 'LeftPanel'
});
ClientList.refresh();
});
Im having the following problem, this code generates no errors no does it render to
the specified 'LeftPanel', where is it going wrong?
/// <reference path="http://extjs.cachefly.net/ext-4.0.2a/ext-all-debug.js" />
/// <reference path="http://extjs.cachefly.net/ext-4.0.2a/resources/css/ext-all.css" />
Ext.onReady(function () {
// Set up a model
Ext.define('Clients', {
extend: 'Ext.data.Model',
fields: [
{ name: 'firstName', type: 'string' },
{ name: 'lastName', type: 'string' }
]
});
var clientstore = Ext.create('Ext.data.Store', {
autoLoad: true,
model: 'Clients',
sorters: 'firstName',
getGroupString: function (record) {
return record.get('firstName')[0];
},
proxy: {
type: 'ajax',
url: 'data/clients.json',
reader: {
type: 'json',
root: 'users'
}
}
});
var ClientList = new Ext.view.View({
store: clientstore,
itemTpl: '<div class="contact"><strong>{firstName}</strong> {lastName}</div>',
grouped: true,
indexBar: true,
//Columns definition
columns: [
{ dataIndex: 'FirstName' },
{ dataIndex: 'LastName' }
],
//Render grid to dom element with id set to panel
renderTo: 'LeftPanel'
});
ClientList.refresh();
});