talpor / django-dashing

django-dashing is a customisable, modular dashboard application framework for Django to visualize interesting data about your project. Inspired in the dashboard framework Dashing
BSD 3-Clause "New" or "Revised" License
731 stars 108 forks source link

Conditional color formating for number widget #75

Closed abakal closed 7 years ago

abakal commented 7 years ago

Hello,

Could you tell me how to get value from detail-field of widget with the rivet.js? To proceed something like that:

rivets.binders['status-color'] = function(el, value) {
    if (value == detail) {
        $(el).css('background-color', 'green');
    }
    else if (value < detail) {
        $(el).css('background-color', 'orange');
    }
    else {
        $(el).css('background-color', 'red');
    }
};

Thank you beforehand. Andrei B.