fix pagination

This commit is contained in:
Harry Bomrah 2015-01-08 20:03:07 +08:00
parent a49fdecb57
commit 3a1d0e6c4e
2 changed files with 25 additions and 18 deletions

View File

@ -34,7 +34,7 @@
</td>
<% else %>
<td>
<a class="btn btn-small btn-primary aprrove-btn" href="/admin/admin_modules/approve?module_id=<%= rm.id.to_s %>">Approve</button>
<a class="btn btn-small btn-primary approve-btn" href="/admin/admin_modules/approve?module_id=<%= rm.id.to_s %>">Approve</button>
</td>
<% end %>
</tr>

View File

@ -43,9 +43,16 @@
</div>
<script type="text/javascript">
var updateTableData = function(){
var data = {},
params = getUrlVars();
$.each(params,function(i,v){
data[v] = params[v];
})
$.ajax({
"url" : "/admin/admin_modules",
"dataType" : "html",
"data" : data,
"type" : "get"
}).done(function(data){
$("#index_table").html(data);
@ -138,14 +145,6 @@
}).done(function(form){
$("#editModal .modal-body").html(form);
$("#editModal").modal("show");
$("#editModal #editModuleBtn").on("click",function(){
$("#approveSiteForm").ajaxSubmit({
success : function(){
updateTableData();
$("#editModal").modal("hide");
}
})
})
})
return false;
})
@ -157,19 +156,27 @@
"dataType" : "html"
}).done(function(form){
$("#approveModal .modal-body").html(form);
$("#approveModal").modal("show");
$("#approveModal #approveModuleBtn").on("click",function(){
$("#approveSiteForm").ajaxSubmit({
success : function(){
updateTableData();
$("#approveModal").modal("hide");
}
})
})
$("#approveModal").modal("show");
})
return false;
})
}
$("#editModal #editModuleBtn").on("click",function(){
$("#approveSiteForm").ajaxSubmit({
success : function(){
updateTableData();
$("#editModal").modal("hide");
}
})
})
$("#approveModal #approveModuleBtn").on("click",function(){
$("#approveSiteForm").ajaxSubmit({
success : function(){
updateTableData();
$("#approveModal").modal("hide");
}
})
})
bindHandlers();
</script>