日期:2014-05-16 浏览次数:20438 次
function renderTable(rsp) {
var count =rsp.length ;//总记录数
var rows = 20;
var cols = Math.ceil(count / rows);
var str = '<table class="tbl">';
str += '<tr>';
for (var i = 0; i < cols; ++i) {
str += '<th >列名1</th><th >列名2</th>';
}
str += '</tr>';
for (var i = 0; i < rows; ++i) {
str += '<tr>';
for (var j = 0 + i; j < count; j = j + rows) {
str += '<td class="clsOne">' + rsp[j].Age+ '</td><td class="clsTwo"><input id="' + rsp[j].NumberTotal+ '" class="easyui-slider"/></td>';
}
str += '</tr>';
}
str += '</table>';
$('.divTable').append(str);
$('.easyui-slider').slider({
showTip: true,
min: 0,
max: 150,
step: 1,
tipFormatter: function (value) {
return value + '岁';
}
});
//table渲染css
$("tr").not(':first').hover(
function () {
$(this).css("background", "red");
},
function () {
$(this).css("background", "");
});
$.parser.parse($('#frmName'));
}