buonzz / jquery-ph-locations

jQuery Plugin for displaying dropdown list of Philippines' Region, Province, City and Barangay in your webpage.

Home Page:https://www.darwinbiler.com/jquery-ph-locations/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Alphabetically sort items upon fetching?

migsyyy opened this issue · comments

Is there an option to have the options sorted alphabetically once fetch_list is called? thanks

Hi @migsyyy,

this is now fixed.

  1. by default, it will automatically sort the dropdown items alphabetically
  2. 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 :)

Hi @migsyyy,

this is now fixed.

  1. by default, it will automatically sort the dropdown items alphabetically
  2. 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!