Skip to main content
Code formatting
Source Link
battery.cord
  • 8.9k
  • 8
  • 32
  • 59

How show Chekcbox checked Show checkbox while loading Lighting Componentcomponent

I have used Check all / Un checkUncheck All checkboxes function to select group of Values. I used to display some data in aura iteration with checkbox values checked. 

If the data row is more than one its working fine suppose if the row count is one im facing error "Uncaught Error in $A.getCallback() [Cannot read property 'set' of undefined]" I used <ui:inputCheckbox>

"Uncaught Error in $A.getCallback() [Cannot read property 'set' of undefined]"

I used <ui:inputCheckbox>

Error in codeCode:

component.find("checkBox")[i].set("v.value", true);    

var recordfinallist = component.get('v.attributename');                   
        for (var i = 0; i < recordfinallist.length; i++) {                       
            if (recordfinallist [i].isvalid__C== true){                                                      
                component.find("checkBox")[i].set("v.value", true);                               
            }                                  
         }                                     
     }

*isvalid__C*isvalid__C is field name

This Similar code is working proper for more than 1 rows but not for one row. Please suggest me some ideas to make checkbox checked by default in lighting using javascript.

How show Chekcbox checked while loading Lighting Component

I have used Check all / Un check All checkboxes function to select group of Values. I used to display some data in aura iteration with checkbox values checked. If the data row is more than one its working fine suppose if the row count is one im facing error "Uncaught Error in $A.getCallback() [Cannot read property 'set' of undefined]" I used <ui:inputCheckbox>

Error in code:

component.find("checkBox")[i].set("v.value", true);    

var recordfinallist = component.get('v.attributename');                   
        for (var i = 0; i < recordfinallist.length; i++) {                       
            if (recordfinallist [i].isvalid__C== true){                                                      
                component.find("checkBox")[i].set("v.value", true);                               
            }                                  
         }                                     
     }

*isvalid__C is field name

This Similar code is working proper for more than 1 rows but not for one row. Please suggest me some ideas to make checkbox checked by default in lighting using javascript.

Show checkbox while loading component

I have used Check all / Uncheck All checkboxes function to select group of Values. I used to display some data in aura iteration with checkbox values checked. 

If the data row is more than one its working fine suppose if the row count is one im facing error:

"Uncaught Error in $A.getCallback() [Cannot read property 'set' of undefined]"

I used <ui:inputCheckbox>

Code:

component.find("checkBox")[i].set("v.value", true);    

var recordfinallist = component.get('v.attributename');                   
        for (var i = 0; i < recordfinallist.length; i++) {                       
            if (recordfinallist [i].isvalid__C== true){                                                      
                component.find("checkBox")[i].set("v.value", true);                               
            }                                  
         }                                     
     }

*isvalid__C is field name

This code is working proper for more than 1 rows but not for one row.

I have used Check all / Un check All checkboxes function to select group of Values. I used to display some data in aura iteration with checkbox values checked. If the data row is more than one its working fine suppose if the row count is one im facing error

Uncaught Error in $A.getCallback() [Cannot read property 'set' of undefined]"

I "Uncaught Error in $A.getCallback() [Cannot read property 'set' of undefined]" I used <ui:inputCheckbox><ui:inputCheckbox>

Error in code: component.find("checkBox")[i].set("v.value", true);

           component.find("checkBox")[i].set("v.value", true);     

var recordfinallist = component.get('v.attributename');                   
                for (var i = 0; i < recordfinallist.length; i++) {                       
                    if (recordfinallist[i]recordfinallist [i].isvalid__C== true){                                                      
                        component.find("checkBox")[i].set("v.value", true);                               
                        }                                  
                    }                                     
                }

*isvalid__C*isvalid__C is field name

This similarSimilar code is working proper for more than 1 rows but not for one row. Please suggest me some ideas to make checkbox checked by default in lightninglighting using javascript.

I have used Check all / Un check All checkboxes function to select group of Values. I used to display some data in aura iteration with checkbox values checked. If the data row is more than one its working fine suppose if the row count is one im facing error

Uncaught Error in $A.getCallback() [Cannot read property 'set' of undefined]"

I used <ui:inputCheckbox>

Error in code: component.find("checkBox")[i].set("v.value", true);

                var recordfinallist = component.get('v.attributename');                   
                for (var i = 0; i < recordfinallist.length; i++) {                       
                    if (recordfinallist[i].isvalid__C== true){                                                      
                        component.find("checkBox")[i].set("v.value", true);                               
                        }                                  
                    }                                     
                }

*isvalid__C is field name

This similar code is working proper for more than 1 rows but not for one row. Please suggest me some ideas to make checkbox checked by default in lightning using javascript.

I have used Check all / Un check All checkboxes function to select group of Values. I used to display some data in aura iteration with checkbox values checked. If the data row is more than one its working fine suppose if the row count is one im facing error "Uncaught Error in $A.getCallback() [Cannot read property 'set' of undefined]" I used <ui:inputCheckbox>

Error in code:

component.find("checkBox")[i].set("v.value", true);     

var recordfinallist = component.get('v.attributename');                   
        for (var i = 0; i < recordfinallist.length; i++) {                       
            if (recordfinallist [i].isvalid__C== true){                                                      
                component.find("checkBox")[i].set("v.value", true);                               
            }                                  
         }                                     
     }

*isvalid__C is field name

This Similar code is working proper for more than 1 rows but not for one row. Please suggest me some ideas to make checkbox checked by default in lighting using javascript.

added 29 characters in body
Source Link
David Reed
  • 93.7k
  • 14
  • 90
  • 166

I have used Check all / Un check All checkboxes function to select group of Values. I used to display some data in aura iteration with checkbox values checked. If the data row is more than one its working fine suppose if the row count is one im facing error "Uncaught Error in $A.getCallback() [Cannot read property 'set' of undefined]" I

Uncaught Error in $A.getCallback() [Cannot read property 'set' of undefined]"

I used <ui:inputCheckbox><ui:inputCheckbox>

Error in code: component.find("checkBox")[i].set("v.value", true); component.find("checkBox")[i].set("v.value", true);

                var recordfinallist = component.get('v.attributename');                   
                for (var i = 0; i < recordfinallist.length; i++) {                       
                    if (recordfinallist[i].isvalid__C== true){                                                      
                        component.find("checkBox")[i].set("v.value", true);                               
                        }                                  
                    }                                     
                }

var recordfinallist = component.get('v.attributename');
for (var i = 0; i < recordfinallist.length; i++) {
if (recordfinallist [i].isvalid__C== true){
component.find("checkBox")[i].set("v.value", true);
}
}
} *isvalid__C*isvalid__C is field name

This Similarsimilar code is working proper for more than 1 rows but not for one row. Please suggest me some ideas to make checkbox checked by default in lightinglightning using javascript.

I have used Check all / Un check All checkboxes function to select group of Values. I used to display some data in aura iteration with checkbox values checked. If the data row is more than one its working fine suppose if the row count is one im facing error "Uncaught Error in $A.getCallback() [Cannot read property 'set' of undefined]" I used <ui:inputCheckbox>

Error in code: component.find("checkBox")[i].set("v.value", true);

var recordfinallist = component.get('v.attributename');
for (var i = 0; i < recordfinallist.length; i++) {
if (recordfinallist [i].isvalid__C== true){
component.find("checkBox")[i].set("v.value", true);
}
}
} *isvalid__C is field name

This Similar code is working proper for more than 1 rows but not for one row. Please suggest me some ideas to make checkbox checked by default in lighting using javascript.

I have used Check all / Un check All checkboxes function to select group of Values. I used to display some data in aura iteration with checkbox values checked. If the data row is more than one its working fine suppose if the row count is one im facing error

Uncaught Error in $A.getCallback() [Cannot read property 'set' of undefined]"

I used <ui:inputCheckbox>

Error in code: component.find("checkBox")[i].set("v.value", true);

                var recordfinallist = component.get('v.attributename');                   
                for (var i = 0; i < recordfinallist.length; i++) {                       
                    if (recordfinallist[i].isvalid__C== true){                                                      
                        component.find("checkBox")[i].set("v.value", true);                               
                        }                                  
                    }                                     
                }

*isvalid__C is field name

This similar code is working proper for more than 1 rows but not for one row. Please suggest me some ideas to make checkbox checked by default in lightning using javascript.

Source Link
Issac Pal
  • 107
  • 1
  • 4
  • 9
Loading