I have created a custom component very similar to the one described is the excellent tutorial Highlighting Critical Data using Templates and Custom Components.
Here’s my inline JavaScript code:
skuid.componentType.register('totalMargin', function (element) {<b>
</b> //Registers Component
var $ = skuid.$;
var m = skuid.model.getModel('Quote');
var row = m.getFirstRow();<b>
</b> var totalFOB = row.Total_FOB_Weighted_Average__c;
var totalExpert = row.Total_Expert_Price_Weighted_Average__c;
var totalTypical = row.Total_Typical_Price_Weighted_Average__c;
var totalFloor = row.Total_Floor_Price_Weighted_Average__c;
var cssClass = null;<b>
</b> if (totalFOB >= totalExpert) {
cssClass = 'box-green';
} else if (totalFOB >= totalTypical) {
cssClass = 'box-yellow';
} else if (totalFOB >= totalFloor) {
cssClass = 'box-orange';
} else {
cssClass = 'box-red';
}<b>
</b> // This wraps the calculated value in the HTML code that applies the same
// styles as we used with the template
var text =
"<div class='box " +
cssClass +
" ui-widget'>" +
"<div class='nx-pagetitle-subtitle' style='text-transform: uppercase;'>" +
" Total Margin " +
"</div>" +
"<div class = 'nx-pagetitle-maintitle'>" +
"{{Total_Margin__c}}" +
"</div>" +
"</div>";<b>
</b> element.append(
m.mergeRow(row, text)
); // Sticks all this HTML code into our custom component.
});
Notice that the background color of the template to colored-coded and conditionally set in the JavaScript.
My issue is that the CSS seems to be correctly set but not applied until I perform a page refresh F5.
Here’s the workflow:
- User performs a mass action and updates one or more rows
- The mass action is defined as Multiple Actions and one of the actions is Update Models
- The last step is Unblock the UI
The models are updated correctly. However, the new CSS is not applied until I hit F5.
What am I missing?

