i hav a controller and my problem is how can i pass variables to my php file so that i can do a new query and fill my store as json out put....
Printable View
i hav a controller and my problem is how can i pass variables to my php file so that i can do a new query and fill my store as json out put....
my controller
......and on my php pageCode:Ext.define('AM.controller.Users', {
extend: 'Ext.app.Controller',
views:[
'user.List','user.Edit','user.West','user.Tabview','user.ReportTree','user.SearchGrid',
],
stores:[
'Users','Policies','SearchGrids',
],
models: [
'User','Gridfill',
],
init: function() {
this.control({
'userlist': {
itemclick: this.searchUser
},
...........remaining codes....
});
},
searchUser: function(grid, record) {//the grid desplayed from userlist view
var searchId=record.get('id');
SearchGrids.load({params: searchId});
var view = Ext.widget('searchGrid');
},
// error SearchGrids is not defined and i tried this var SearchGrids= Ext.data.StoreManager.lookup('mystore'); and still the same error...what shall i doCode:$sId=$_POST['searchId'];
then do query.....
Did you try SearchGrids = Ext.data.StoreManager.lookup('SearchGrids')?
plus 'mystore' is the storeId of my store(SearchGrids);
Controller add getters for stores:
Code:searchUser: function(grid, record) {//the grid desplayed from userlist view
var SearchGrids = this.getSearchGridsStore(), // or SearchGrids = grid.getStore(),
searchId=record.get('id');
SearchGrids.load({
params: {
searchId: searchId
},
callback: function () {
// store loaded
}
});
},
the abovedo exactly like i wanted but after loading the view which have a grid that uses SearchGrid the refresh button is not working....because..Code:var SearchGrids= this.getSearchGridsStore();
SearchGrids.load({
params: {
searchId: searchId
},.......
on the php file would be null...after refreshing the grid....how can i solve that.....another is i usedCode:$sId=$_POST['searchId'];
to load the view...so how can i close the first opend view before another one is loaded ....i tried this oneCode:var view=Ext.widget('SearchGrid');
but does not close itCode:Ext.widget('SearchGrid').close();
Use proxy extraParams:
Code:searchUser: function(grid, record) {//the grid desplayed from userlist view
var SearchGrids = this.getSearchGridsStore(), // or SearchGrids = grid.getStore(),
searchId=record.get('id');
SearchGrids.proxy.extraParams.searchId = searchId;
SearchGrids.load(
callback: function () {
// store loaded
}
});
if (this.searchGridWin) {
// close opened window
this.searchGridWin.close();
//this.searchGridWin.destroy(); // if window closeAction != 'destroy' uncomment
this.searchGridWin = null;
} else {
this.searchGridWin = Ext.widget('SearchGrid');
this.searchGridWin.show();
}
},