Display inherited rows a bit differenter

This commit is contained in:
Oliver Walters 2021-02-17 22:25:43 +11:00
parent 5b402b6bc0
commit 1eb2456e3d
3 changed files with 23 additions and 11 deletions

View File

@ -307,6 +307,11 @@
font-style: italic; font-style: italic;
} }
.rowinherited {
background-color: #efe;
opacity: 90%;
}
.dropdown { .dropdown {
padding-left: 1px; padding-left: 1px;
margin-left: 1px; margin-left: 1px;

View File

@ -72,11 +72,9 @@
</div> </div>
</div> </div>
<table class='table table-striped table-condensed' data-toolbar="#button-toolbar" id='bom-table'> <table class='table table-bom table-condensed' data-toolbar="#button-toolbar" id='bom-table'>
</table> </table>
<table class='table table-striped table-condensed' id='test-table'></table>
{% endblock %} {% endblock %}
{% block js_load %} {% block js_load %}

View File

@ -420,15 +420,24 @@ function loadBomTable(table, options) {
sortable: true, sortable: true,
search: true, search: true,
rowStyle: function(row, index) { rowStyle: function(row, index) {
if (row.validated) {
return { var classes = [];
classes: 'rowvalid'
}; // Shade rows differently if they are for different parent parts
} else { if (row.part != options.parent_id) {
return { classes.push('rowinherited');
classes: 'rowinvalid'
};
} }
if (row.validated) {
classes.push('rowvalid');
} else {
classes.push('rowinvalid');
}
return {
classes: classes.join(' '),
};
}, },
formatNoMatches: function() { formatNoMatches: function() {
return '{% trans "No BOM items found" %}'; return '{% trans "No BOM items found" %}';