随笔-0  评论-5  文章-26  trackbacks-0

以下是从store中精确定位数据的几种方法:

var data = {
    'rowCountFather': 
3,
    rowCountSon: 
3,
    'fatherData': [
{
        fatherId: 'father',
        fatherName: '
1',
        fatherIconCls: 'manage'
    }
{
        fatherId: 'father',
        fatherName: '
2',
        fatherIconCls: 'manage'
    }
{
        fatherId: 'father',
        fatherName: '
3',
        fatherIconCls: 'manage'
    }
],
    sonData: [
{
        sonId: 'son',
        sonName: 'ho1',
        sonIconCls: 'manage'
    }
{
        sonId: 'son',
        sonName: 'ho2',
        sonIconCls: 'manage'
    }
{
        sonId: 'son',
        sonName: 'ho3',
        sonIconCls: 'manage'
    }
]
}
;

var store = new Ext.data.JsonStore({
    data: data,
    autoLoad: 
true,
    root: 'fatherData',
    fields: ['fatherId', 'fatherName', 'fatherIconCls']
}
)


alert(
"data" + data.rowCountFather);
alert(store.reader.jsonData['rowCountFather']);
alert(store.getAt(
0).get('fatherName'));
alert(store.reader.jsonData.fatherData[
0].fatherName);
alert(store.reader.jsonData.sonData[
0].sonName);
posted on 2009-05-15 17:14 L.J. 阅读(322) 评论(0)  编辑  收藏 所属分类: EXT

只有注册用户登录后才能发表评论。


网站导航: