自己写了一个需要重用的XTemplate  如下
'<div style="font-size:12px;">',
'<div class="browse_realtime">',
'<div class="x-hb-tl">',
'<div class="x-hb-tr">',
'<div class="x-hb-tc">',
'<div class="x-more">',
'<center><a href="{moreAction}">更多</a></center>',
'</div>',
'<h2 class="x-window-header-text" id="{tabId1}" onmouseover="tab(id);">{name}</h2>',
'<h2 class="x-window-header-text2" id="{tabId2}" onmouseover="tab();">{tab2}</h2>',
'<h2 class="x-window-header-text3" id="{tabId3}" onmouseover="tab();">{tab3}</h2>',
'</div>',
'</div>',
'</div>',
'<div class="x-hb-ml">',
'<div class="x-hb-mr">',
'<div class="x-hb-mc">',
'<table>',
'<tpl for=".">',
'<tr>',
'<td><li>{#}【{typeValue}】<a href="../classifyn/ViewEditDialog.jsp?gaId={gaId}">{title}</a></li></td>',
'<td><span>{clickCount}</span></td>', '</tr>', '</tpl></table>',
' </div>', '</div>', ' </div>', ' <div class="x-hb-bl">',
'<div class="x-hb-br">', ' <div class="x-hb-bc"></div>',
'</div>', ' </div>', '</div>', '</div>');
for循环里面的是list 能正常显示.目前想从页面添加{moreAction} {tab1}等变量.(这些值根据new的不同的panel写死在前台页面)
请问怎么操作  网上没找到相关的说法  
也考虑过从后台传moreAction过来 但是jsonStore 不会写.
传过来的json格式如下
{moreAction:"www.baidu.com",gaDataList:[{area:"001001",attentionCount:0,care:"004002"},{...},{...}]}
在线等 求大神extXTemplate

解决方案 »

  1.   

    不知道你这个json最终是不是放到store里面去的
    如果最终的data是这个的话
    {moreAction:"www.baidu.com",gaDataList:[{area:"001001",attentionCount:0,care:"004002"},{...},{...}]}仅从数据上看的话,,可以看成moreAction和gaDataList 两个字段,gaDataList又是一个数组
    最外面是本条数据的tpl,然后是gaDataList 的tpl'<tpl for="gaDataList">'   这里需要改成这样,循环gaDataList你可以考虑递归或者子模版的方式
    store的fields的值可以是数组,你自己再解析就是了
    比较乱,没测试,希望是对的