Juicer 使用范例
来源:互联网 发布:订单管理数据流程图 编辑:程序博客网 时间:2024/06/02 05:07
导入juicer
<script type="text/javascript" src="juicer-min.js"></script>
在js部分编写模板页面
<script id="connectionTpl" type="text/template">
<input type="hidden" value="{%id}" id="mid"/>
<div class="portlet-title">
<div class="caption">
<i class="icon-sitemap"></i>XXX
</div>
</div>
<div class="portlet-body flip-scroll">
<table class="table table-bordered table-striped table-condensed flip-content">
<thead class="flip-content">
<tr class="table-border-bottom" align="center">
<th style="width: 5%; word-wrap: break-word; word-break: break-all;">序号</th>
<th>XXX</th>
<th>XXX</th>
<th>XXX</th>
<th>XXX</th>
<th>XXX</th>
<th>XXX</th>
</tr>
</thead>
<tbody>
{@if list.length==0}
<tr align="center"><td colspan="7"><font color="red">目前没有已关联的商品</font></td></tr>
{@/if}
{@each list as item,i}
<tr align="center" id="{%item.id}">
<td>{%i-0+1}</td>
<td><img src="{%item.thumbUrl}" class="iconStyle" /></td>
<td>{%item.productName}</td>
<td>{@if item.productCode!=null}{%item.productCode}{@/if}</td>
<td style="text-align:right;">{%item.salesVolume}</td>
<td>
{@if item.status=='I' }
<i class="icon-remove" />
{@/if}
{@if item.status=='A' }
<i class="icon-ok" />
{@/if}
</td>
<td value="{%item.id}">
<span class='single{@if item.connection=='S'} highlighticon{@/if}' title="XXX"><i class="icon-long-arrow-right"></i></span>
<span style="margin-left:5px;" class='both{@if item.connection=='B'} highlighticon{@/if}' title="XXX"><i class="icon-resize-horizontal"></i></span>
</td>
</tr>
{@/each}
</tbody>
</table>
</div>
<div class="pull-right">
<button id="addConnection" class="btn blue" value="{%id}">XXX</button>
<div>
<div class="pull-right" style="margin-top:20px;"></div>
</script>
这里面有一些条件判断语句,还有一些是和后台绑定数据的语句。
使用js调用这个模板
var connectionTpl =document.getElementById('connectionTpl').innerHTML;
$('#connection').html(juicer(connectionTpl, {id:id,list:products}));
然后就成了。
总结
我目前就学了这么多,写这儿算是给自己一个备份,欢迎评论。谢谢。
- Juicer 使用范例
- juicer.js 使用 示例
- juicer
- 安装juicer
- juicer语法
- A. Juicer
- [codeforces] Juicer
- juicer 入门教程
- ASPHTTP使用范例
- 游标使用经典范例
- W3 Jmail 使用范例
- jsp bean使用范例
- TreeView 使用范例
- TreeView 使用范例
- awk使用范例
- xAjax简单使用范例
- IHttpHandler使用范例
- IHttpHandler使用范例
- Android CardView 控件学习
- font-size 与line-height:14px; 小记
- IOS常用宏定义
- Android发送post请求的两种写法(okHttp&&httpClient)
- informix系统表
- Juicer 使用范例
- C++动态库(Dll)的制作,导出类
- vs2010 启动失败
- java注解
- Android ontouch 拖动与点击事件冲突解决方式
- 用Erlang开发的九大开源项目汇总及介绍
- netstat
- 最大公约数的简单算法
- Android平台的 Ptrace, 注入, Hook 全攻略