launch: function() {
var items=new Array();
var db = new PGSQLitePlugin("addressBook.db", function(dbResult, dbObject){
db = dbObject;
db.executeSql("select ORG_ID ,ORG_NAME from KM_ORG WHERE ORG_TYPE='0' order by ORG_ORDER asc", function(data){
var json= data.rows;
for(var i=0;i<json.length;i++){
var dep=json[i].ORG_NAME;
var id=json[i].ORG_ID;
var t={
title: dep,
slideButton: {
selector: 'toolbar'
},
items: [{
xtype: 'toolbar',
title: '',
docked: 'top'
},{
xtype: 'panel',
items:[{xtype:'button',text: id}]
}]
};
items.push(t);
};
var data=JSON.stringify(items);
localStorage.setItem("data",data);
}, function(err){
console.log( err);
});
}, function(err){
console.log( err);
});
Ext.Viewport.add(Ext.create('Email.view.Main'));}
Email.view.Main.js
Ext.define("Email.view.Main", {
extend: 'Email.view.Slidenavigation',
requires: [
'Ext.Container',
'Ext.MessageBox',
'Ext.Panel',
'Ext.Toolbar',
'Ext.event.publisher.Dom'
],
config: {
fullscreen: true,
slideSelector: 'x-toolbar',
selectSlideDuration: 200,
list: {
maxDrag: 400,
width: 200,
items: [{
xtype: 'toolbar',
docked: 'top',
ui: 'light',
title: {
title: '用户名',
centered: false,
width: 200,
left: 0
}
}]
},
defaults: {
style: 'background: #fff',
xtype: 'container'
}
},
initConfig:function(){
debugger;
var self=this;
var items=localStorage.getItem("data");
var d= JSON.parse(items);
self.config.items=d;
self.callParent();
localStorage.removeItem("data");
}
});
留着 备忘一下