Alphabetically sort items upon fetching?
migsyyy opened this issue · comments
migsyyy commented
Is there an option to have the options sorted alphabetically once fetch_list is called? thanks
Darwin Biler commented
Hi @migsyyy,
this is now fixed.
- by default, it will automatically sort the dropdown items alphabetically
- If you need more control of the sorting, you can pass a
order
parameter to the plugin
$('#region').ph_locations({
"location_type": "regions",
"order" : "name asc"
});
the value of the order parameter is
- possible values for field: name, region_code
- possible values for sort direction: asc, desc
let me know if that works for you :)
migsyyy commented
Hi @migsyyy,
this is now fixed.
- by default, it will automatically sort the dropdown items alphabetically
- If you need more control of the sorting, you can pass a
order
parameter to the plugin$('#region').ph_locations({ "location_type": "regions", "order" : "name asc" });
the value of the order parameter is
- possible values for field: name, region_code
- possible values for sort direction: asc, desc
let me know if that works for you :)
Thanks a lot! It works now. This is a big help. And btw PSA just recently released updates on some barangay names. Again, thanks a lot!