jquery的template模版功能
template模版{%each(i) data%}\${i+1}查看容器报文详情\${flightNo}\${DateFormat(flightDate,'yyyy-MM-dd')}\${tailNo}\${DateFormat(flightTime,'y
·
template模版
<script id="trTemplate" type="text/x-jquery-tmpl">
{%each(i) data%}
<tr>
<td>\${i+1}</td>
<td>
<button type="button" class="btn btn-primary btn-xs" containerId="\${recordId}">查看容器</button>
<button type="button" class="btn btn-success btn-xs" data-toggle="modal" data-target="#messageInfo" msgId="\${msgId}">报文详情</button>
</td>
<td>\${flightNo}</td>
<td>\${DateFormat(flightDate,'yyyy-MM-dd')}</td>
<td>\${tailNo}</td>
<td>\${DateFormat(flightTime,'yyyy-MM-dd hh:mm:ss')}</td>
<td>\${departAirport}</td>
<td>\${destAirport}</td>
<td>\${DateFormat(opTime,'yyyy-MM-dd hh:mm:ss')}</td>
<td>
{%if recordStatus==0%}
未出港
{%/if%}
{%if recordStatus==1%}
已出港
{%/if%}
</td>
</tr>
{%/each%}
</script>
调用给指定元素添加html模版
$("#trTemplate").tmpl(returnObj).appendTo("#contentContainer");
更多推荐
已为社区贡献9条内容
所有评论(0)