sorry for the late response.  in the middle of huge Wicket rewrite of old
JSP app.  Below is the example usage we use.  I doesn't sort onload since
that is done in the backend. Tested this in IE 8/7/6.  



Wicket.Palette.sortOptions=function(box) {
        var data = new Array();
        for(i = 0; i < box.options.length; i++) {               
                data[i] = new Array();
                data[i][0] = box.options[i].text;
                data[i][1] = box.options[i].value; 
        }
                
        data.sort(function(a, b) {
                var aa = a[0].toLowerCase();
                var bb = b[0].toLowerCase();            
                return ((aa < bb) ? -1 : ((aa > bb) ? 1 : 0));          
        });     
                
        for(i = 0; i < data.length; i++) {              
                var op = new Option(data[i][0], data[i][1]);
                box.options[i] = null;
                box.options[i] = op;
        }       
        
}

Wicket.Palette.remove=function(choicesId, selectionId, recorderId) {
        var choices=Wicket.Palette.$(choicesId);
        var selection=Wicket.Palette.$(selectionId);
        if (Wicket.Palette.moveHelper(selection, choices)) {
                var recorder=Wicket.Palette.$(recorderId);
                Wicket.Palette.updateRecorder(selection, recorder);             
        
                $(choices).change();            
        }
        Wicket.Palette.sortOptions(choices);
}

Wicket.Palette.updateRecorder=function(selection, recorder) {   
        recorder.value="";      
        Wicket.Palette.sortOptions(selection);
        for (var i=0;i
-- 
View this message in context: 
http://old.nabble.com/automatic-palette-sorting-tp28096974p28238166.html
Sent from the Wicket - User mailing list archive at Nabble.com.

Reply via email to