pull/6/head
guanghongwei 2015-01-10 12:30:21 +08:00
parent 662c48ed37
commit 0c30e8fd53
3 changed files with 57 additions and 29 deletions

View File

@ -63,3 +63,5 @@ def user_add(request):

View File

@ -144,6 +144,24 @@ function WinMove() {
opacity: 0.8, opacity: 0.8,
}) })
.disableSelection(); .disableSelection();
}; }
// Checkbox select all
function selectAll(){
var checklist = document.getElementsByName ("selected");
if(document.getElementById("select_all").checked)
{
for(var i=0;i<checklist.length;i++)
{
checklist[i].checked = 1;
}
}else
{
for(var j=0;j<checklist.length;j++)
{
checklist[j].checked = 0;
}
}
}

View File

@ -27,34 +27,42 @@
</div> </div>
</div> </div>
<div class="ibox-content" style="display: block;"> <div class="ibox-content" style="display: block;">
<table class="table table-hover"> <form method="post" action="">
<thead> <table class="table table-hover">
<tr> <thead>
<th> <tr>
<div class="radio i-checks"> <th>
<input type="checkbox" value="1" name="j_is_active" checked> <div class="checkbox i-checks">
</div> <input onclick="selectAll()" type="checkbox" name="select_all" style="select_all" id="select_all">
</th> </div>
<th>ID</th> </th>
<th>缁勫悕</th> <th>ID</th>
<th>澶囨敞</th> <th>缁勫悕</th>
</tr> <th>澶囨敞</th>
</thead> </tr>
<tbody> </thead>
{% for group in groups %} <tbody>
<tr> {% for group in groups %}
<td> <tr>
<div class="radio i-checks"> <td>
<input type="checkbox" value="1" name="j_is_active" checked> <div class="checkbox i-checks">
</div> <input type="checkbox" value="{{ group.id }}" name="selected">
</td> </div>
<td>{{ group.id }}</td> </td>
<td>{{ group.name }}</td> <td>{{ group.id }}</td>
<td>{{ group.comment }}</td> <td>{{ group.name }}</td>
</tr> <td>{{ group.comment }}</td>
{% endfor %} </tr>
</tbody> {% endfor %}
</table> </tbody>
</table>
<div class="form-group">
<div class="col-sm-4 col-sm-offset-2">
<button class="btn btn-white" type="submit">鍙栨秷</button>
<button id="submit_button" class="btn btn-primary" type="submit">纭鍒犻櫎</button>
</div>
</div>
</form>
</div> </div>
</div> </div>
</div> </div>