Can I return this data in any particular order?
@RemoteAction
public String unitList {
get {
return JSON.serializePretty(All_Data__c.getAll().values());
}
}
Perhaps by using
ORDER BY
somehow and specifying a field?
I print it out here:
var unit_list_items = {!unitList};
var openUnitList = function (unitdiv) {
jQuery('div.unit_dropdown').remove();
var unit_ul = jQuery('<ul>'),
unit_dr = jQuery('<div>')
.addClass('unit_dropdown')
.append(unit_ul);
unit_dr.appendTo(unitdiv);
jQuery.each(unit_list_items, function (idx, val) {
unit_ul.append(jQuery('<li>')
.addClass('unit_list_items')
.text(val.Name));
});
};
But it seems to return in no particular order.