Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a lookup combobox whose source is another SharePoint list. By default, this combobox items are sorted by word order but I want to sort this items with another/custom order. How can I do this?

Such as the default view of this combobox is:

EUR    
USD    
TRY

But I want this combobox with this sort:

TRY    
EUR    
USD

My source list order is the same with following:

Currency CurrencySeq

TRY       1
EUR       2
USD       3
share|improve this question

1 Answer 1

There aren't any server side solutions for doing that unfortunately.

You could check the following solution provided by this post

$(function(){
    var fieldLabel = "LookupField";
    var lookup = $("h3:contains("+ fieldLabel +")").closest("td").next().find("select");
    $(lookup).find("option").sort(function(a,b){
        if(b.innerHTML == 'Test2') return 1;
        return 0;
    }).appendTo($(lookup));
});

Another alternartive, if you are willing to use Infopaths, if I remember well, you can set a sorting on the datasource.

Hope it helps.

share|improve this answer
    
Thank you so much for your help. It helped me and I solved my problem. I did not use JavaScript or JQuery but I found a way at InfoPath as you said. When I wanted to choose a new data source for combobox, I could create a new data connection through InfoPath and choose any column to sort my combobox items. –  compengTR Apr 30 '12 at 12:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.