In List view, change whole row color like as odd and even.
@mohsininspire I don’t think that you can change the row color unless you create a plugin that extend the ListView js file. But instead you can change the indicator color and you can count for odd and even rows.
var _count = 1;
function _isOdd(n) { return n > 0 && (n % 2) == 1; }
frappe.listview_settings['Doctype Name'] = {
get_indicator(doc) {
// customize indicator color
if (_isOdd(_count++)) {
return [__("Odd"), "red", "odd,=,Yes"];
} else {
return [__("Even"), "green", "odd,=,No"];
}
},
};
1 Like