grubby69
13 Sep 2011, 1:23 AM
Hi!
I have a big problem that maybe it's a stupid misunderstanding...
I cannot pass a changed value of a variable from the handler to the main!!!
I want to have a List and when I tap on a row(parent) I want to have a second list(child) and then tapping on a row I will have the expanded data.
The problem is that when I tap the first time to build the second list of childs rows ,the Store load itself with the extraparams 'r_idx_p' value to NULL and so the server don't make the right query and the list is NULL.
Infact if I set forcing the r_idx_p to 1 (a correct value of the parent,the query is ok and jsn is ok and the second list is right rendered.
The problemis ONLY pass the r_idx_p value taken byt the event to the store.
But HOW?????
here is the code of the handler:
//gestione del tap
//setto sublist slide
tapSubListHandler = function(list, index, item, e) {
//assegno valori dei campi record
rec = Ext.getCmp('listId').getStore().getAt(index);
r_idx_p = parseInt(rec.get('IDX_PADRE'));//eseguo il parseInt per trasformare l'oggetto in numero intero
Ext.getCmp('sublistId').getStore().load();
mainPanel.setActiveItem(mySlideSubList, {type: 'slide'});
//mainPanel.setActiveItem(mySlideSubList, {type: 'slide'});
//mySlideSubList.doLayout();
};
and here is the code of the store:
//inizializzo variabili
r_idx_p = 'null';
r_idx_f = 'null';
r_data = 'null';
r_tinfo = 'null';
r_vuser = 'null';
r_vimg = 'null';
substore = new Ext.data.Store({
storeId: 'mysubStoreId',
model : 'List',
proxy: {
type: 'ajax',
url : 'app/lettura_sub_db_json_old.php',
extraParams: {datap: r_idx_p},
reader: {
type: 'json',
root: 'list'
}
},
autoLoad: false
});
I have a big problem that maybe it's a stupid misunderstanding...
I cannot pass a changed value of a variable from the handler to the main!!!
I want to have a List and when I tap on a row(parent) I want to have a second list(child) and then tapping on a row I will have the expanded data.
The problem is that when I tap the first time to build the second list of childs rows ,the Store load itself with the extraparams 'r_idx_p' value to NULL and so the server don't make the right query and the list is NULL.
Infact if I set forcing the r_idx_p to 1 (a correct value of the parent,the query is ok and jsn is ok and the second list is right rendered.
The problemis ONLY pass the r_idx_p value taken byt the event to the store.
But HOW?????
here is the code of the handler:
//gestione del tap
//setto sublist slide
tapSubListHandler = function(list, index, item, e) {
//assegno valori dei campi record
rec = Ext.getCmp('listId').getStore().getAt(index);
r_idx_p = parseInt(rec.get('IDX_PADRE'));//eseguo il parseInt per trasformare l'oggetto in numero intero
Ext.getCmp('sublistId').getStore().load();
mainPanel.setActiveItem(mySlideSubList, {type: 'slide'});
//mainPanel.setActiveItem(mySlideSubList, {type: 'slide'});
//mySlideSubList.doLayout();
};
and here is the code of the store:
//inizializzo variabili
r_idx_p = 'null';
r_idx_f = 'null';
r_data = 'null';
r_tinfo = 'null';
r_vuser = 'null';
r_vimg = 'null';
substore = new Ext.data.Store({
storeId: 'mysubStoreId',
model : 'List',
proxy: {
type: 'ajax',
url : 'app/lettura_sub_db_json_old.php',
extraParams: {datap: r_idx_p},
reader: {
type: 'json',
root: 'list'
}
},
autoLoad: false
});