0

I have a list of wrapper class list tempList

public class employeeBookedClass{
    public string locationName;
    public string locationDate;
    public string trainerName;
    public string uniqueId;

    public employeeBookedClass(string locationName, string locationDate, 
                               string trainerName){
        this.locationName = locationName;
        this.locationDate = locationDate;
        this.trainerName = trainerName;
        this.uniqueId = locationDate + '~' + locationName;

    }
}

Now I want to loop over the list in javascript.

for(var ids in listEmplyee){
console.log(ids + '>>>' + listEmplyee[ids]);
}

This is what I get in javascript and want to loop over that.

[employeeBookedClass:[locationDate=19/02/2018, locationName=London, trainerName=Nayank, uniqueId=19/02/2018~London], employeeBookedClass:[locationDate=12/03/2018, locationName=Rajasthan, trainerName=Chris, uniqueId=12/03/2018~Rajasthan]]
5
  • You can use apex:repeat directly in JavaScript to iterate over the list. Commented Feb 13, 2018 at 7:43
  • How would apex: tag work in javascript ??? That is an HTML tag right.. ? Commented Feb 13, 2018 at 7:47
  • Really sorry, This is not I am looking for.. I am not good with javascript. Can't we create a class in javascript and parse that in javascript Commented Feb 13, 2018 at 7:52
  • The way we parse json into a wrapper class in apex.. Commented Feb 13, 2018 at 7:54
  • In short .. how can I loop over this list in javascript:::::: [employeeBookedClass:[locationDate=19/02/2018, locationName=London, trainerName=Nayank, uniqueId=19/02/2018~London], employeeBookedClass:[locationDate=12/03/2018, locationName=Rajasthan, trainerName=Chris, uniqueId=12/03/2018~Rajasthan]] Commented Feb 13, 2018 at 7:57

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.