Forum /
Sencha Touch 2.x Forums /
Sencha Touch 2.x: Q&A /
Unanswered: back button doesn't work!
Unanswered: back button doesn't work!
this is my view file
CustMain.js
Ext.define( 'SFA-BMT.view.CustMain', {
extend: 'Ext.navigation.View',
xtype: 'custMain',
requires: [
'Ext.form.FieldSet',
'Ext.dataview.List',
'Ext.data.proxy.Ajax',
'Ext.field.Search',
'Ext.data.Store',
'Ext.field.Select',
'SFA-BMT.model.MDL_COMMON'
],
initialize:function (){
this .loadCombo();
this .loadCustList();
},
loadCombo: function (){
var custStore = new Ext.data.Store({
model: 'SFA-BMT.model.MDL_COMMON',
proxy:{
type:'ajax' ,
url: 'SPMMain.spm?connection=L&pg_mode=dev&sql=mdms/mp/cust:BMT_CUST_TYPE&datatype=json',
reader: {
type:'json' ,
rootProperty:'dataset.row'
}
},
autoLoad:true
});
var grpStore = new Ext.data.Store({
model: 'SFA-BMT.model.MDL_COMMON',
proxy:{
type:'ajax' ,
url: 'SPMMain.spm?connection=L&pg_mode=dev&sql=mdms/mp/cust:BMT_SC_GRP&datatype=json',
reader: {
type:'json' ,
rootProperty:'dataset.row'
}
},
autoLoad:true
});
Ext.getCmp('selectGrp' ).setStore(grpStore);
Ext.getCmp('selectCustType' ).setStore(custStore);
},
loadCustList:function (){
var custStore = new Ext.data.Store({
autoLoad: true ,
fields: [ 'CUST_NM', 'CUST_SEQ', 'HP', 'CR_TYPE', 'CUST_TYPE_NM', 'CUST_TYPE', 'SC_GRP_SEQ'],
proxy: {
type: 'ajax' ,
url: 'SPMMain.spm?connection=L&pg_mode=dev&sql=mdms/mp/cust:BMT_CUST&datatype=json',
reader: {
type: 'json' ,
rootProperty: 'dataset.row'
}
}
});
Ext.getCmp('custList' ).setStore(custStore);
},
config:{
title: 'Contact' ,
iconCls: 'user' ,
fullscreen: true ,
// url : 'contact.php',
navigationBar: {
hidden: false ,
},
items: [{
xtype: 'list' ,
// itemTpl: '{title}',
itemTpl: '<div style="width:100%;height:100%;display:inline-block;margin:auto auto">'+
'<p style="width:100%;font-size:14px;margin-right:3px;color:#2233ff"><span style="font-size:20px;margin-right:10px;color:black">{CUST_NM}</span>{CUST_TYPE_NM}</p>'+
'<p style="width:100%;font-size:14px;margin-right:3px;color:#2233ff"><span style="font-size:20px;margin-right:10px;color:black">{HP}</span>{CR_TYPE}</p>'+
'</div>' ,
fullscreen: true ,
id: 'custList',
loadingText:'조회중..' ,
emptyText:'데이터가 없습니다!' ,
// ui : 'round',
pinHeaders: false ,
onItemDisclosure: true ,
// title: 'Recent Posts',
items: [{
xtype: 'button' ,
style: 'width:98%;height:40px;margin:10px auto',
scrollDock: 'bottom' ,
docked: 'bottom' ,
text: 'Load More...'
},{
xtype: 'toolbar' ,
docked: 'top' ,
style: 'width:100%' ,
layout: {
type: 'vbox' ,
align: 'middle'
},
items:[ {
xtype: 'searchfield' ,
name: 'search' ,
placeHolder: '이름 또는 전화번호' ,
style:'width:90%' ,
listeners: {
change: function (field, evt) {
//Ext.getCmp('myFieldSet').setTitle(field.getValue());
} // keyup
} // listeners
},{
xtype: 'selectfield' ,
label: 'GROUP' ,
labelWidth: 70,
style:'width:90%' ,
id: 'selectGrp',
displayField : 'CODE_NM' ,
valueField : 'CODE' ,
listeners: {
change: function (field, evt) {
//this.getStore().filter("",field.getValue());
} // keyup
} // listeners
},{
xtype: 'selectfield' ,
label: 'TYPE' ,
labelWidth: 70,
style:'width:90%' ,
id: 'selectCustType',
displayField : 'CODE_NM' ,
valueField : 'CODE' ,
listeners: {
change: function (field, evt) {
//Ext.getCmp('myFieldSet').setTitle(field.getValue());
} // keyup
} // listeners
}] // items (toolbar ) }
}]
}] // items
}
});
and this is my controller file.
CustMainControl.js
Ext.define( 'SFA-BMT.controller.CustMainControl', {
extend: 'Ext.app.Controller',
config: {
refs: {
custMain: 'custMain'
},
control: {
'custMain list' : {
itemtap : 'showCustDetail'
}
}
},
showCustDetail: function (list, index, element, record){
this .getCustMain().push({
xtype: 'custSimple' ,
title: record.get('CUST_NM' ),
html: record.get('CUST_SEQ' ),
scrollable: true ,
styleHtmlContent: true
});
}
});
when I tap an item on a list it works fine but, when I tap a back button from a detail view,
it doesn't work, what's wrong? does anyone have a solution??
Sencha is used by over two million developers. Join the community, wherever you’d like that community to be
or Join Us