I have a container containing a toolbar and an alias to a list.when i push the container in a navigation view,it show the toolbar with an empty list .however,if i push only the list,the list show the items inside the store correctly,but it can't fire the event of itemptap when i choose an item from the list.Can anyone help me with these problem?
My container:
Ext.define('Myapp.view.segma',{
//extend:'Ext.Container',
extend:'Ext.Container',
xtype: 'segma',
requires:[
'Ext.SegmentedButton',
'Myapp.store.RouteStore',
],
config:{
store:'RouteStore',
cls:'card',
items:[
{
xtype: 'toolbar',
ui: 'light',
docked: 'bottom',
scrollable: false,
items: [
{
xtype: 'spacer'
},
{
xtype: 'segmentedbutton',
allowDepress: true,
items: [
{
text: 'Permanent',
pressed: true
},
{
text: 'Temporary'
},
]
},
{
xtype: 'spacer'
}
]
},
{
xtype: 'ListRegister',
}
]
},
})
My list:
Ext.define('Myapp.view.ListRegister', {
// extend: 'Ext.form.Panel',
extend: 'Ext.dataview.List',
xtype: 'ListRegister',
requires: [
'Ext.TitleBar',
'Ext.form.FieldSet',
'Ext.Button',
'Ext.field.Search',
],
config: {
itemId: 'routeList',
title: 'Search for a route',
store : 'RouteStore',
onItemDisclosure: true,
itemTpl: '<div class="myroute">'+
'<div> {Route_Name}</div>'
,
//<div class="avatar" style="background-image: url()"</div>>
emptyText: '<div class="myroute">No Matching routes</div>',
items: [
{
xtype: 'searchfield',
docked: 'top',
label: '',
placeHolder: 'Search for a Route Name',
itemId: 'searchBox'
}
],
listeners:[
{
fn:'onRouteListItemTap',
event:'itemtap',
delegate:'#routeList'
}
]
},
//it can't fire this function when i select an item from the list
onRouteListItemTap:function (dataview, index, target, record, e, options) {
console.log("onRouteListItemTap");
this.fireEvent('routeSelectCommand', this, record);
}
});
part of controller:
a fire to a previous list
onPicktap: function (dataview) {
var store = Ext.getStore('RouteStore');
store.load();
console.log( store.getCount());
dataview.up('navigationview').push({
//xtype: 'ListRegister', //if used ,it loads correctly and show the items inside the list correctly
xtype:'segma' // load correctly,but show an empty list,although the store count shows the correct number loaded
})
},
Aucun commentaire:
Enregistrer un commentaire