This controller property will provide a JSON string of all the list custom setting entries:
public String infoListJson {
get {
return JSON.serializePretty(Info_List__c.getAll().values());
}
}
and that JSON can be picked up in the Visualforce like this:
<script>
...
var infoListJson = {!infoListJson};
...
</script>
Or if you just want to return the Info_Field__c values and not the other fields of the list custom setting:
public String infoListJson {
get {
String[] infoFields = new String[] {};
for (Info_List__c item : Info_List__c.getAll().values()) {
infoFields.add(item.Info_Field__c);
}
return JSON.serializePretty(infoFields);
}
}