sencha0773/senchatouch-beginner — Issue #1: bindstore
Author: sencha0773
Created: 2012-03-02 11:13:51+00:00
State: open

Hi,
m facinng the issue with bindstore.anyone plz have a look in to my app n give suggestion..
Thanks in advance.

here is my app..
function calladdlistofclassWS(){

// var addlistofclass = goCampus.views.addlistofclass;
// goCampus.views.viewport.setActiveItem(addlistofclass, { type: 'slide', direction: 'left' });

loadingMask = new Ext.LoadMask(Ext.getBody(), {msg:"Loading..."});
loadingMask.show();
// alert("hi");
//	goCampus.backButton.setHandler(function(){
//	var addlistofclass = goCampus.views.addlistofclass;
//	goCampus.views.viewport.setActiveItem(addlistofclass,{type: 'slide',direction: 'right'});
//	var backBtn = goCampus.backButton;
//	backBtn.setHandler(backHome);
//	});
Ext.util.JSONP.request({
url: './JsonServlet',
params: {
//format: 'json',
callback: 'callback',
ws: 'CS',
un: 'STUD1',
pwd: 'welcome',
emplid: 'SF0019',
career: 'UGRD', //localStorage.getItem('career'),
institute:'PSUNV', // localStorage.getItem('institute'),
term: '0670', //localStorage.getItem('term')
//clsnbr: localStorage.getItem('clsnbr')
//emplid: 'AA0001'
},
method: 'GET',
callbackKey: 'callback',
callback: function(result) {
if(result){

var addlistofclass = goCampus.views.addclasslist;
goCampus.views.viewport.setActiveItem(addlistofclass, { type: 'slide', direction: 'left' });

Ext.StoreMgr.clear('facusearchmodel');
facusearchStore.removeAll();
facusearchStore.add(result);
addlistofclass.update();
addclasslist.bindStore(facusearchStore);

addclasslist.doComponentLayout();
addlistofclass.doLayout();

/* var subjectmatched = [];
var subjecttemp;
for (i = 0; i < facusearchStore.getCount(); i++) {
if (facusearchStore.getAt(i).data.subject.match(subjecttemp)) {}
else {
subjectmatched.push(facusearchStore.getAt(i).data);
subjecttemp = facusearchStore.getAt(i).data.subject;
}
}
Ext.StoreMgr.clear('facusearchmodel');
facusearchStore.removeAll();
facusearchStore.add(subjectmatched);

// goCampus.views.viewport.setActiveItem(addlistofclass, { type: 'slide', direction: 'left' });

/*	addclasslist.addListener('itemTap', function(list, index) {
//alert("index"+index + ''+ list.store.getAt(index).get('subjectmatched[0]'));

var backBtn = goCampus.backButton;
backBtn.setHandler(function(){
backBtn.setHandler(backHome);
goCampus.views.viewport.setActiveItem(addlistofclass, { type: 'slide', reverse: true });
});*/

//var record = list.store.getAt(index);
//var ccDetails = record.get('desc1');
//var holdsPanel = goCampus.views.holds;
//var toolbar = Ext.getCmp('holdsDetails');
//toolbar.setTitle(ccDetails);
//holdsPanel.update('');
//holdsPanel.update(siTpl.applyTemplate(record));
//var coursedetailedPanel = goCampus.views.stdCourseCatalogdetailPanel;
goCampus.views.viewport.setActiveItem(addlistofclass, { type: 'slide', direction: 'left' });
//	});

}else{
alert("Error. Server not responding");
}
loadingMask.hide();
}
});
}