How do I sort and add unique array options to a DropDownList using jQuery? -


i have array of objects “allclaimants” has 2 properties (userinfo & userid);

example:

allclaimants[allclaimantscounter].userinfo = "santhalingam sugirtha, 1980-06-05"; allclaimants[allclaimantscounter].userid = "1076073"; 

my allclaimants[allclaimantscounter].userinfo information contains 2 things “name + date of birth”.

how can sort (by userinfo - in userinfo want sort name part not date of birth) , add unique values select dropdown (claimantsdropdown) text allclaimants[allclaimantscounter].userinfo , value allclaimants[allclaimantscounter].userid?

thanks

you convert array list

array.aslist(array)  

and use linq like

list.orderby(x=> x.key) 

and depend on type of dropdrown have fill it, if dropdown aspnet server control use list datasource.


Comments

Popular posts from this blog

Javascript line number mapping -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -