We have a table this is referencing the default lightning sort icons and need to replace all three(up, down, both) with different svg images from static resources.
The current code references standard utility and would like to change the references in the conditional to point to the /resources directory. If the conditional was in the component, it may be easier but it's in the controller js.
handleSort: function(component, event, helper) {
var item = event.currentTarget;
var cname = item.dataset.cname;
console.log('cname = ' + cname);
var sortIcons = component.get("v.sortIcons");
var iconName = sortIcons[cname];
console.log('iconName = ' + iconName);
for (var k in sortIcons) {
if (k != cname) {
sortIcons[k] = 'utility:sort';
}
}
var first = 0;
var second = 0;
if (iconName == 'utility:sort' || iconName == 'utility:arrowdown'){
sortIcons[cname] = 'utility:arrowup';
first = 1;
second = -1;
} else if (iconName == 'utility:arrowup') {
sortIcons[cname] = 'utility:arrowdown';
first = -1;
second = 1;
}
component.set("v.sortIcons", sortIcons);
Suggestions?