Snippets

Create an account or login to be able to add, comment and rate snippets.

Navigation

jQuery AdminDoubleList replacements

jQuery AdminDouble List

These two js functions do the job while using jQuery with admin double list

function double_list_move(src, dest)
{
    var L = $(src).children();
    $(L).each(function(i){
        if(L[i].selected){
            $(dest).append('<option value="'+$(L[i]).val()+'">'+ $(L[i]).text()+'</option>');
            $(L[i]).remove();
        }
    });
 
}
 
function double_list_submit()
{
    var sel = $("form").find("select.sf_admin_multiple-selected");
    var C = $(sel).children();
    $(C).each(
        function(i){
            if(!C[i].selected)
                C[i].selected=true;
        }
    );
 
}
 

Enjoy it.

by Thomas Schäfer on 2008-03-19, tagged helper  javascript  jquery 
You need to create an account or log in to post a comment or rate this snippet.