Code:
/**
* View which contains all the jobs returned
* to the user search criteria.
*/
Ext.define('Mh.view.Homepage', {
extend: 'Ext.Container',
xtype: 'homepagecard',
config: {
layout:'vbox',
title:'H',
items: [
{xtype:'toolbar',
//Definition of the top docked toolbar
docked: 'top',
items: [
{xtype:'spacer'},
{
xtype:'searchfield',
name: 'search',
placeHolder: 'Search Job',
listeners:{
action:function(obj,e,opts){
jbstore = Ext.getCmp('jlist').getStore();
jbproxy = jbstore.getProxy();
//All the code below is workaround to
//bypass the serverside call , two files named
//manager.json and architect.json mock the search result
jbproxy.url='jobs/'+obj.getValue()+'.json';
//jbproxy.setExtraParam('title',obj.getValue());
jbstore.load({url:'jobs/'+obj.getValue()+'.json'},{
callback: function(records, operation, success) {
console.log(records);
},
scope: this
});
}
}
},
{xtype:'spacer'}
]
},
{
xtype: 'container',
layout: {
type: 'hbox'
},
flex: 1,
items: [
{
xtype: 'container',
layout: {
type: 'vbox'
},
flex: 1,
items: [
{
xtype: 'container',
flex: 4,
items: [
{
xtype: 'image',
centered: true,
height: 60,
width: 60,
src: 'resources/icons/find_a_job.png',
id:'imgFindJob'
}
]
},
{
xtype: 'container',
html: 'Find Job',
style: 'text-align:center;',
flex: 1
}
]
},
{
xtype: 'container',
layout: {
type: 'vbox'
},
flex: 1,
items: [
{
xtype: 'container',
flex: 4,
items: [
{
xtype: 'image',
centered: true,
height: 60,
width: 60,
src: 'resources/icons/edit_contact_details.png',
id:'imgEditCont'
}
]
},
{
xtype: 'container',
html: 'My Account',
style: 'text-align:center;',
flex: 1
}
]
}
]
},
{
xtype: 'container',
layout: {
type: 'hbox'
},
flex: 1,
items: [
{
xtype: 'container',
layout: {
type: 'vbox'
},
flex: 1,
items: [
{
xtype: 'container',
flex: 4,
items: [
{
xtype: 'image',
centered: true,
height: 60,
width: 60,
src: 'resources/icons/job_basket.png',
id:'imgJobBasket'
}
]
},
{
xtype: 'container',
html: 'Job Basket',
style: 'text-align:center;',
flex: 1
}
]
},
{
xtype: 'container',
layout: {
type: 'vbox'
},
flex: 1,
items: [
{
xtype: 'container',
flex: 4,
items: [
{
xtype: 'image',
centered: true,
height: 60,
width: 60,
src: 'resources/icons/alerts.png',
id:'imgAlerts'
}
]
},
{
xtype: 'container',
html: 'Alerts',
style: 'text-align:center;',
flex: 1
}
]
}
]
},
{
xtype: 'container',
layout: {
type: 'hbox'
},
flex: 1,
items: [
{
xtype: 'container',
layout: {
type: 'vbox'
},
flex: 1,
items: [
{
xtype: 'container',
flex: 4,
items: [
{
xtype: 'image',
centered: true,
height: 60,
width: 60,
src: 'resources/icons/job_rss _feed.png',
id:'imgRssFeed'
}
]
},
{
xtype: 'container',
html: 'Job RSS',
style: 'text-align:center;',
flex: 1
}
]
},
{
xtype: 'container',
layout: {
type: 'vbox'
},
flex: 1,
items: [
{
xtype: 'container',
flex: 4,
items: [
{
xtype: 'image',
centered: true,
height: 60,
width: 60,
src: 'resources/icons/contact_h.png',
id:'imgContactH'
}
]
},
{
xtype: 'container',
html: 'Contact Us',
style: 'text-align:center;',
flex: 1
}
]
}
]
}
]
}
});