Code snippets for symfony 1.x

Navigation

Refine Tags

Snippets tagged "jquery"

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