• Pritesh Maturkar
  • NEWBIE
  • 30 Points
  • Member since 2018

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
I have create  lightning components.
In this I have add Jquery but it given Error:
" Cannot read property 'expando' of undefined throws"
I have added single JS File.
<ltng:require scripts="{!$Resource.JqueryJS}" afterScriptsLoaded="{!c.doInit}" />

Please Help me?


 
I have create  lightning components.
In this I have add Jquery but it given Error:
" Cannot read property 'expando' of undefined throws"
I have added single JS File.
<ltng:require scripts="{!$Resource.JqueryJS}" afterScriptsLoaded="{!c.doInit}" />

Please Help me?


 
--------I am not getting how to write a test calss for this apex controller?
public class OV_ObjectUtility {
    public static void getData(){
        List<String> ids = new List<String>();
        ids.add('001U0000004ZjhgIAC');
        ids.add('0010B00001lL1VEQA0');
        ids.add('001e0000018SOK5AAO');
        ids.add('001e0000018SOKAAA4');
        lightningTableWrapper ffff= getRecordsForSearch('Account','Name, OriginalAccountName__c, TradestyleName__c, Continent__c, BillingCity, BillingCountry, website, BillingPostalCode, BillingState, BillingStreet, Id',ids);
        
        system.debug('----Final Query Datas ---'+ffff); 
    }
    public static lightningTableWrapper getRecordsForSearch(String ObjectName,String fieldstoget,List<String> ids){     
        lightningTableWrapper ltw = new lightningTableWrapper();
        String wherecon='';
        try{            
            for(String str : ids){
                if(str!=null){
                    wherecon = wherecon+ ' \''+str + '\',' ;
                }
            }
            wherecon = wherecon.subString(0,wherecon.length()-1);
            String queryString = 'Select '+ String.escapeSingleQuotes(fieldstoget)+
                ' from '+ String.escapeSingleQuotes(ObjectName)+
                ' where id in ('+wherecon+')';
            system.debug('----Final Query---'+queryString);
       
            List<sobject> sObjectsList = new List<sobject>();
           
            sObjectsList.addAll(database.query(queryString));
            system.debug('----Final Query Datas ---'+sObjectsList);
            ltw.sObjectrecords = sObjectsList;
        }catch(Exception e){
        }
        return ltw;
    }
}