So I'm fairly new to sencha touch. Recently I started a building a simple app in 1.1 and then realized 2.0 existed. I'm prone to using the latest greatest so I though I'd give it a shot since I'm just learning I don't want to learn the old way.
I have an MVC app all setup with 2.0 details below:
Controller: Main
Views: Viewport (Ext.tabPanel), ListUsers (Ext.list), and Donations (Ext.list)
Models: User (ajax proxy), Donation (ajax proxy)
Stores: Users, Donations
The Main controller instantiates the Viewport view and everything loads in fine. The tab functionality is working great I can switch to and from the ListUser to Donations views without a problem.
My issues is that the lists themselves are not populating. They data doesn't show. I'm not sure how to check that Users or donations stores are indeed getting the info from the server, is that possible? They are set to autoLoad but I've not gotten any errors so I'm just not sure.
In my insainty of trying to work this out I tested making ListUsers a regular panel with a simple bit of HTML just to be sure they were rendering, which worked. So My thought is either a.) my data is not loaded or b.) it's loaded by I'm doing something wrong preventing it from showing.
Any help or a direction in how I can troubleshoot why this is happening would be greatly appreciated. Below is my main controller, Viewport and ListUser views for reference.
Main.js (Controller)
Code:
Ext.define('AdminApp.controller.Main', {
extend: 'Ext.app.Controller',
requires: ['AdminApp.store.Users'],
models: ['User', 'Donation'],
stores: ['Users', 'Donations'],
views: ['Viewport', 'ListUsers', 'ShowUser', 'Donations'],
init: function() {
console.log('controller Loaded');
Ext.Viewport.setActiveItem({xtype: 'Viewport'});
this.control({
'Viewport': {
show: console.log('viewport loaded')
},
'ListUser': {
show: console.log('listusers loaded')
},
})
}
});
Viewport. js (View)
Code:
Ext.define('AdminApp.view.Viewport', {
extend: 'Ext.tab.Panel',
alias: 'widget.Viewport',
requires: ['AdminApp.view.ListUsers', 'AdminApp.view.ShowUser'],
layout: 'card',
config: {
scrollable: true,
tabBarPosition: 'bottom',
items: [
{
xtype: 'ListUsers',
title: 'Users',
iconCls: 'user',
// html: 'testing'
},
{
xtype: 'Donations',
title: 'Donations',
iconCls: 'bookmarks',
// html: 'testing'
}
]
}
});
ListUser (View)
Code:
Ext.define('AdminApp.view.ListUsers', {
extend: 'Ext.List',
alias: 'widget.ListUsers',
requires : ['AdminApp.store.Users'],
config: {
fullscreen: true,
itemTpl: '<span>{user_id}</span>',
store: 'AdminApp.store.Users',
items: [],
html: 'testing'
}
});