How to access store value in sencha touch -


i trying store value this:

 itemtap : function(list, index, target, record) {        ext.getstore("namestore").load();       console.dir("test->"+record.get('id'));       console.dir("test->"+record.get('address'));  } 

here cannot id, when itemtap. , try this:

  var store= ext.getstore('namestore');   console.dir("test->"+store.get('id'));   console.dir("test->"+store.get('address')); 

but not data. why this?

and what difference between this, 2 type of store value access?

i add onclick inside div, itemtap working fine in iphone not working? why this? there alternative present in sencha working both android iphone , others.how value in itemptap, displayed in div display store.

edited:

 itemtap :function(list, index, target, record) { console.log("clicked---"+record.get('cat_id')); } 

actually, not getting above code.

i try this, , getting value

console.log("clicked--"+record.data.data[index].cat_id); 

getting first value always, because index value 0, every category tapped. so, here want index of tapped category.

works fine, if this:

{               xtype: 'list',            itemid: 'catlist',           scrollable: false,      data: [     { name: 'a', cat_id: 1},     { name: 'b', cat_id: 2},     { name: 'c', cat_id: 3},     { name: 'd', cat_id: 4},     { name: 'e', cat_id: 5},       ],     loadingtext: "loading words...",     emptytext: '<div>{message}</div>',     autoload:true,     itemtpl:[     '<tpl for=".">',           '<span >{name}</span> ',                    '</tpl>',     ]    }, 

why 'reloading' store on itemtap callback? should loaded , not necessary load() again.

even if want update store, should wait load() finish before doing record.get(). remember load() async.

the second block never work because get() method record, re executing store.

itemtap : function(list, index, target, record) {       console.dir("test->" + record.get('id'));       console.dir("test->" + record.get('address')); } 

Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -