You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

36 lines
1.1 KiB

import {AbsBaseSelect} from './base/AbsBaseSelect'
import NoTreeData from './data/NoTreeData'
export default class NoTreeSelect extends AbsBaseSelect{
constructor($container, {url, obj, visible=true, required = false}){
//TODO: сделать автоматическую передачу всех параметров родителю
super($container, {url, obj, visible, required});
}
_buildComponents(data) {
super._buildComponents(data);
this.dataTree = this.dataTree || new NoTreeData(data.results || data);
this.$buttonAddOptions.hide();
this._fillOptionsData();
this._bindEvents();
}
_onclickOptionsElement(e) {
this.selectedEl.id = $(e.target).data("id");
this.selectedEl.value = $(e.target).html();
this.$searchInput.val($(e.target).html());
this.$buttonAddOptions.show();
this.$optionsBox.hide();
this.selectedContainer.add(this.selectedEl.id);
this.clear();
e.preventDefault();
return false;
}
_onButtonAddOptions(e) {
// pass
}
}