2

Anyone know how to set a background color for Lightning Progress Step when the current step is set to failed/error?

COMPONENT:

<lightning:progressIndicator aura:id="progressIndicator" currentStep="{!v.currentStage}" type="path" hasError="{!v.currentStageIsError}" />

CONTROLLER:

initializeProgressIndicator : function(component,event,helper) {        
  var progressIndicator = component.find('progressIndicator');
  for (let step of component.get('v.stages')) {
     $A.createComponent(
        "lightning:progressStep",
        {
           "aura:id": "step_" + step,
           "label": step,
           "value": step
         },

         function(newProgressStep, status, errorMessage){

            // Add the new step to the progress array
            if (status === "SUCCESS") {
               var body = progressIndicator.get("v.body");
               body.push(newProgressStep);
               progressIndicator.set("v.body", body);

                 //Progress Step Error                         
                 if ( component.get('v.currentStageIsError') === false ) {
                    var currentStep = component.get('v.currentStage');
                    //var currentStepError = component.find("step_" + currentStep);
                    var currentStepError = component.find('steps');
                    $A.util.addClass(currentStepError, 'slds-is-lost');   

                    console.log("PROGRESS No Errors " + currentStep + ' ' + currentStepError) 
                 }
             }
             else if (status === "INCOMPLETE") {
                // Show offline error
                console.log("No response from server, or client is offline.")
              }
              else if (status === "ERROR") {
                 // Show error message
                 console.log("Error: " + errorMessage);
              }
          }
       );
   }

  this.setDefaultLanguage(component);
},
0
0

I just try to inspect this process indicator component, seems like background color not changing. This is weird... enter image description here

1
  • try to append this class 'slds-is-lost' to the active step it will change background to red.. that's what trying to do with the dynamically created lightning:progressStep – yajeglav Apr 16 '19 at 8:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.