All Downloads are FREE. Search and download functionalities are using the official Maven repository.

resources.tools_javascript_jquery-picklist.min.js Maven / Gradle / Ivy

There is a newer version: 1.14.4
Show newest version
(function(c){c.widget("awnry.pickList",{widgetEventPrefix:"pickList_",options:{mainClass:"pickList",listContainerClass:"pickList_listContainer",sourceListContainerClass:"pickList_sourceListContainer",controlsContainerClass:"pickList_controlsContainer",targetListContainerClass:"pickList_targetListContainer",listClass:"pickList_list",sourceListClass:"pickList_sourceList",targetListClass:"pickList_targetList",clearClass:"pickList_clear",listItemClass:"pickList_listItem",richListItemClass:"pickList_richListItem",
selectedListItemClass:"pickList_selectedListItem",addAllClass:"pickList_addAll",addClass:"pickList_add",removeAllClass:"pickList_removeAll",removeClass:"pickList_remove",addAllLabel:">>",addLabel:">",removeAllLabel:"<<",removeLabel:"<",listLabelClass:"pickList_listLabel",sourceListLabel:"Available",sourceListLabelClass:"pickList_sourceListLabel",targetListLabel:"Selected",targetListLabelClass:"pickList_targetListLabel",sortItems:!0,sortAttribute:"label",listItemValueAttribute:"data-value",
items:[]},_create:function(){this._buildPickList();this._refresh()},_buildPickList:function(){this._trigger("beforeBuild");this.pickList=c("
").hide().addClass(this.options.mainClass).insertAfter(this.element).append(this._buildSourceList()).append(this._buildControls()).append(this._buildTargetList()).append(c("
").addClass(this.options.clearClass));this._populateLists();this.element.hide();this.pickList.show();this._trigger("afterBuild")},_buildSourceList:function(){var a=c("
").addClass(this.options.listContainerClass).addClass(this.options.sourceListContainerClass).css({"-moz-user-select":"none", "-webkit-user-select":"none","user-select":"none","-ms-user-select":"none"}).each(function(){this.onselectstart=function(){return!1}}),b=c("
").text(this.options.sourceListLabel).addClass(this.options.listLabelClass).addClass(this.options.sourceListLabelClass);this.sourceList=c("
    ").addClass(this.options.listClass).addClass(this.options.sourceListClass).delegate("li","click",{pickList:this},this._changeHandler);a.append(b).append(this.sourceList);this.sourceList.delegate(".pickList_listItem", "dblclick",{pickList:this},function(a){a=a.data.pickList;a._addItems(a.sourceList.children(".ui-selected"))});return a},_buildTargetList:function(){var a=c("
    ").addClass(this.options.listContainerClass).addClass(this.options.targetListContainerClass).css({"-moz-user-select":"none","-webkit-user-select":"none","user-select":"none","-ms-user-select":"none"}).each(function(){this.onselectstart=function(){return!1}}),b=c("
    ").text(this.options.targetListLabel).addClass(this.options.listLabelClass).addClass(this.options.targetListLabelClass); this.targetList=c("
      ").addClass(this.options.listClass).addClass(this.options.targetListClass).delegate("li","click",{pickList:this},this._changeHandler);a.append(b).append(this.targetList);this.targetList.delegate(".pickList_listItem","dblclick",{pickList:this},function(a){a=a.data.pickList;a._removeItems(a.targetList.children(".ui-selected"))});return a},_buildControls:function(){this.controls=c("
      ").addClass(this.options.controlsContainerClass);this.addAllButton=c("




© 2015 - 2024 Weber Informatics LLC | Privacy Policy