magix-components
Version:
69 lines (67 loc) • 2.31 kB
HTML
<h2>mx-checkbox</h2>
<div class="pt20 clearfix">
<table class="table table-striped">
<thead>
<tr>
<th><input type="checkbox" class="checkbox" linkage="example1" /></th>
<%for(var i=0;i<5;i++){%>
<th>示例字段<%=i%></th>
<%}%>
</tr>
</thead>
<tbody>
<%for(var i=0;i<10;i++){%>
<tr>
<td><input type="checkbox" class="checkbox" linkage-parent="example1" value="ex1_<%=i%>" /></td>
<%for(var j=0;j<5;j++){%>
<td>示例字段内容<%=j%></td>
<%}%>
</tr>
<%}%>
</tbody>
</table>
<div class="clearfix">
<button class="fr mt5 btn btn-brand" mx-click="showEx1()">显示选中的checkbox</button>
</div>
</div>
<div class="pt20">
<div>HTML Code:</div>
<pre><table class="table table-striped">
<thead>
<tr>
<th><input type="checkbox" class="checkbox" linkage="example1" /></th>
<%for(var i=0;i<5;i++){%>
<th>示例字段<%=i%></th>
<%}%>
</tr>
</thead>
<tbody>
<%for(var i=0;i<10;i++){%>
<tr>
<td><input type="checkbox" class="checkbox" linkage-parent="example1" value="ex1_<%=i%>" /></td>
<%for(var j=0;j<5;j++){%>
<td>示例字段内容<%=j%></td>
<%}%>
</tr>
<%}%>
</tbody>
</table>
<div class="clearfix">
<button class="fr mt5 btn btn-brand" mx-click="showEx1()">显示示例1选中的checkbox</button>
</div></pre>
<div class="pt10">Javascript Code:</div>
<pre>let Magix = require('magix');
let Linkage = require('app/gallery/mx-checkbox/linkage');
let GTip = require('app/gallery/mx-gtip/index');
module.exports = Magix.View.extend({
tmpl: '@linkage.html',
mixins: [Linkage, GTip],
render() {
let me = this;
me.updater.digest();
},
'showEx1<click>' () {
this.gtipRT(this.getSelectedIds('example1'));
}
});</pre>
</div>