Easyui datagrid 根据条件改变颜色:
$("#txtMaterialNum").keydown(function (e) {
if (e.keyCode != 13 || $.trim($("#txtMaterialNum").val()) == "") return;
var _mm = $.trim($("#txtMaterialNum").val());
var rows = $("#datagrid_list").datagrid("getRows");
var _sn = "";
for (var i = 0; i < rows.length; i++) {
if ($.trim(_mm) == $.trim(rows[i].MATERIAL_SN)) {
$("#datagrid-row-r1-2-" + i).css({ "background-color": "green", "color": "white" });
}
}
});