PDA

View Full Version : Extjs 4 with servlet



bothman
4 Dec 2015, 3:23 AM
Hi
I am trying to use get data from database and display it in grid
so I followed the example : http://www.mysamplecode.com/2011/12/extjs-4-mvc-architecture-tutorial-using_8986.html

but when I run it nothing display in the page

I think there is something wrong in using the defined xtype : itemlist

Ext.application({
name: 'IN',

appFolder: 'app',

controllers: [
'Items'
],

launch: function() {
Ext.create('Ext.container.Viewport', {
items: [
{
xtype: 'itemlist'
}
]
});
}
});

please help

Gary Schlosberg
4 Dec 2015, 6:13 AM
I'm not seeing an 'itemlist' xtype in the docs.
http://docs.sencha.com/extjs/4.2.1/#!/api

bothman
4 Dec 2015, 6:34 AM
I define this xtype in my List.js

bothman
4 Dec 2015, 6:35 AM
Ext.define('IN.view.item.List', {
extend : 'Ext.grid.Panel',
alias : 'widget.itemlist',
title : 'List of Items',
store : 'Items',
loadMask : true,
autoheight : true,

initComponent : function() {

this.columns = [{
header : 'User Name',
dataIndex : 'user-name',
flex : 1
}, {
header : 'Password',
dataIndex : 'password',
flex : 1
}, {
header : 'Description 1',
dataIndex : 'desc1',
flex : 1
}, {
header : 'Description 2',
dataIndex : 'desc2',
flex : 1
}, {
header : 'Description 3',
dataIndex : 'desc3',
flex : 1
}];

this.callParent(arguments);
}

});

Gary Schlosberg
4 Dec 2015, 7:32 AM
I don't see an 'autoHeight' config in the docs for the grid panel. Can you try setting a fixed height to see if that displays your grid? If that doesn't work, are you seeing any errors in the console?

bothman
7 Dec 2015, 12:27 AM
thank you the problem is solved