0

In the Component,I have used disabled option

<aura:attribute name="isDisabled" type="Boolean" default="true"/>
<aura:attribute name="overprice" type="Decimal" default="0"/>

In helper class,how to use disabled attribute

Helper Code:

   var overprice = 0; 
            produto.produtoDoPedido.ManualOverprice__c = produto.produtoDoPedido.ManualOverprice__c != null ? (parseFloat(produto.produtoDoPedido.ManualOverprice__c)*10)/10 : 0.00;
                if (inputCmp.get("v.id") === "overprice" && inputCmp.get("v.name") === produto.produtoDoPedido.Id) {
                        produto.produtoDoPedido.ManualOverprice__c = 0.00;
                        overprice = parseFloat(inputCmp.get("v.value")) * 10;
                        produto.produtoDoPedido.ManualOverprice__c = overprice / 10;
                        produto.produtoDoPedido.NegotiatedPrice__c = produto.produtoDoPedido.UnitPrice + parseFloat(serviceLevelValue) + produto.produtoDoPedido.ManualOverprice__c;
            objProducts.ManualOverprice = objSplited.produtoDoPedido.ManualOverprice__c;
    '<th style="border: 1px solid gray; line-break:auto;">'+ $A.get("$Label.c.AVX_Overprice") + '</th>'+
            var overprice = produto.produtoDoPedido.ManualOverprice__c;
            var formatOverprice = parseFloat(overprice).toFixed(2);
                '<td style="border: 1px solid gray; text-align:center;">' + formatOverprice + '</td>'+
                            var maxNegotationPrice = parseFloat(info.LimitOverprice__c);
                                else if (parseFloat(product.produtoDoPedido.ManualOverprice__c) > parseFloat(maxNegotationPrice)) {
                                var maxNegotationPrice = parseFloat(info.LimitOverprice__c);
                                  else if (parseFloat(product.produtoDoPedido.ManualOverprice__c) > parseFloat(maxNegotationPrice)) {

How to use Disabled attribute in helper class for Lightining component.I need to disable the Over Price field.

0

1 Answer 1

0

See the code below I think it could help you, so you use one Boolean variable in the "disabled" property

<aura:attribute name="isDisabled" type="Boolean" default="true" required="false" />

            <div class="slds-size_1-of-2 slds-align_absolute-center">
                Address:<lightning:input name="text" disabled="{!v.isDisabled}"/>
            </div>

And then in the JS you control the isDisabled variable:

onCheck : function(component, event, helper) {
     component.set("v.isDisabled" , false);
},
3
  • I need to disable the field of Overprice, where i need to give disable option for Overprice field
    – user88356
    Commented Jan 29, 2021 at 14:21
  • Hi boris salesforce.stackexchange.com/questions/331848/… continuation, since it is affected by two fields, i need a specific field called Overpirce
    – user88356
    Commented Jan 29, 2021 at 14:34
  • Ok now I see how you construct the HTML. Is it really necessary to construct the HTML like that, SF has a great functionalities for that kind of things, that you are not using here ? Commented Jan 29, 2021 at 15:39

You must log in to answer this question.