Topic: Sorting For materialSelect

infinity free asked 4 years ago

Hey Guys.

Ok so I have a material select which is populated at run time using jquery, ajax and then reinitializing the materialSelect.

An example of the js output is {"2":"Abuse Of Power","1":"Time Related Offences"} but as soon as jquery inserts it using the code below the sorting is thrown out, and it sorts according to key, not value... How can I sort these options by alphabetical order?


$.each(data, function(key,value) {

Grzegorz Bujański staff commented 4 years ago

Hi. Please create snippet here: i will look at this.

Please insert min. 20 characters.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.



Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.14.0
  • Device: Laravel
  • Browser: Chrome
  • OS: Windows
  • Provided sample code: No
  • Provided link: No