我的'<tpl for="images"> 这里设置成for="."的时候就能正常显示数据。可是换成for="images"的时候就显示不了了。
这是为什么啊?哪位高人帮看看。
以下是部分代码:
var store = new Ext.data.JsonStore({
        url: '../ajax/testss.php',
        root: 'images',
        fields: ['name', 'url']
    });
    store.load();stor返回的数据格式是这样的:{"images":[{"name":"10000021654321","url":"10000021654321"},{"name":"10000021123456","url":"10000021123456"},{"name":"10000021123123","url":"10000021123123"}]} var t = new Ext.XTemplate(
    '<tpl for="images"><p><div name="{id}"></div></p></tpl>'
    );
t.compile();以下是panel var fsf = new Ext.FormPanel({
       labelWidth: 75, 
        id:'fjy.report_search',
        frame:true,
        title: '评估报表',
        region: 'center', 
        bodyStyle:'padding:10px 10px 0',
  items: [{
            xtype:'fieldset',
            collapsible:true,
            title: '真实身份信息',
            autoHeight:true,
            //collapsed: true, 
            items :  new Ext.DataView({
            store: store,
         tpl: t})
        }]
  renderTo: document.body
     });

解决方案 »

  1.   

    好象是:取JSON的分段数据然后重复,其实就个循环..
      

  2.   

    <tpl   for= "images ">这个就是将 images 里边的内容循环输出啊,不知道为什么不行
    改成<tpl   for= ".">这样就可以
      

  3.   


    这也和store里的root有关的好象.
      

  4.   

     root:   'images ', 已经是从此节取了,所以for="."就好了.
    root:"data",for="images"
      

  5.   


    如果我的stor返回的数据格式是这样的:{ "images ":[{ "name ": "10000021654321 ", "url ": "10000021654321 "},{ "name ": "10000021123456 ", "url ": "10000021123456 "}],"result":[{ "a": "10000021654321 ", "b": "10000021654321 "},{ "a": "10000021123456 ", "b": "10000021123456 "}]}
    呢?