Add new group to other user's group select forms
This commit is contained in:
parent
5121c262e2
commit
949cab7ea1
2 changed files with 9 additions and 2 deletions
|
@ -35,6 +35,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
button.click(function(event){
|
button.click(function(event){
|
||||||
|
|
||||||
var button=$(this);
|
var button=$(this);
|
||||||
if(button.parent().children('ul').length>0){
|
if(button.parent().children('ul').length>0){
|
||||||
button.parent().children('ul').slideUp(400,function(){
|
button.parent().children('ul').slideUp(400,function(){
|
||||||
|
@ -136,11 +137,11 @@
|
||||||
var option=$('<option selected="selected"/>');
|
var option=$('<option selected="selected"/>');
|
||||||
option.attr('value',$(this).val());
|
option.attr('value',$(this).val());
|
||||||
option.text($(this).val());
|
option.text($(this).val());
|
||||||
select.append(options);
|
select.append(option);
|
||||||
li.prev().children('input').trigger('click');
|
li.prev().children('input').trigger('click');
|
||||||
button.parent().data('preventHide',false);
|
button.parent().data('preventHide',false);
|
||||||
if(settings.createCallback){
|
if(settings.createCallback){
|
||||||
settings.createCallback();
|
settings.createCallback($(this).val());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -40,7 +40,13 @@ $(document).ready(function(){
|
||||||
}else{
|
}else{
|
||||||
checkHandeler=false;
|
checkHandeler=false;
|
||||||
}
|
}
|
||||||
|
var addGroup = function(group) {
|
||||||
|
$('select[multiple]').each(function(index, element) {
|
||||||
|
$(element).append('<option value="'+group+'">'+group+'</option>');
|
||||||
|
})
|
||||||
|
};
|
||||||
element.multiSelect({
|
element.multiSelect({
|
||||||
|
createCallback:addGroup,
|
||||||
createText:'add group',
|
createText:'add group',
|
||||||
checked:checked,
|
checked:checked,
|
||||||
oncheck:checkHandeler,
|
oncheck:checkHandeler,
|
||||||
|
|
Loading…
Reference in a new issue