onLoadSuccess: function (data) {
var _bool = mzServer.Msg.isSelectVal();
if (!angular.isUndefined(_bool)) {
var cloum = _bool["cloums"];
if (!angular.isUndefined(cloum)) {
for (var i = 0; i < cloum.length; i++) {
$(element).find('tbody tr td').each(function () {
var keyval = $(this).find("input[type='checkbox'],input[type='radio']").attr("value");
if (keyval == cloum[i]) {
$(this).parent("tr").addClass("selected");
$(this).find("input[type='checkbox'],input[type='radio']").attr("checked", true);
}
})
for (var u = 0; u < data.rows.length; u++) {
var keyid = attrs.idfield;
if (data.rows[u][keyid] == cloum[i]) {
data.rows[u][0] = true;
}
}
}
}
}
//else {
//if (!angular.isUndefined(data.rows[0]))//默认第一项选中
// {
// data.rows[0][0]= true;
// $(element).find('tbody>tr[data-index="0"]').addClass("selected");
// $(element).find('tbody>tr>td>input[data-index="0"]').attr("checked", true);
// }
// }
tableHeight(element, data);
},
function tableHeight(element, data) {
var _rowsT = data.rows.length;
var _hightT = $(element).height();
if (_rowsT < 15) {
$(element).closest(".fixed-table-container").height(_hightT-20);
}
}