Since Django Chinese is garbled in the foreground, this article uses the Django template to generate the table, and then uses the jquery grid to process the table.
<link href= ". /pqgrid.min.css "rel=" stylesheet ">
<script type= "Text/javascript" src= ". /js/pqgrid.min.js "></script>
<script type= "Text/javascript" src= ". /js/pq-localize-zh.js "></script>
<div id= "grid_table" ></div> for displaying jquery grid tables
<table border= "1" cellspacing= "0" cellpadding= "0" class= "fortune500" style= "Margin:auto;" >
<tbody>
<tr >
<th> Gift Pack Id</th>
<TD > Gift Package name </td>
<th >CDK remaining Volume </th>
<th> Package Content </th>
<TD > Build Date </td>
</tr>
<tbody>
{% for gift in gift_lists%} Django-Generated tables
<tr>
<TD >{{gift.gift_id}}</td>
<TD >{{gift.gift_name}}</td>
<TD >{{gift.gift_nums}}</td>
<TD >{{gift.gift_content}}</td>
<TD >{{gift.gift_time}}</td>
</tr>
{% ENDFOR%}
<!--repeating rows end--
</tbody></table>
<script>
$ (function () {
$ ("table.fortune500"). CSS (' Min-height ', (jQuery (' #right '). Height () -200) + "px");
$ ("table.fortune500"). CSS (' Min-width ', jQuery (' #right '). Width () + "px");
var tbl = $ ("table.fortune500");
var obj = $.paramquery.tabletoarray (TBL);
var newObj = {
Width:jquery (' #right '). Width () + "px",
Height:jquery (' #right '). Height () + "px",
Title: "More information query (refresh please press F5)",
Flexheight:true,
Flexwidth:true,
Bottomvisible:true, display the bottom of the table so that the pagination can be displayed
Freezecols:5, the column is not allowed to drag horizontally, altogether 5 columns, so set to 5
};
Newobj.datamodel = {Data:obj.data, rpp:25, paging: "Local"}; Set Paging information
Newobj.colmodel = Obj.colmodel;
$ ("#grid_table"). Pqgrid (NEWOBJ);
TBL.CSS ("Display", "none");
});
</script>
This article is from the "Python Django Jqurey" blog, so be sure to keep this source http://tomyu.blog.51cto.com/705648/1408779