javascript OpenProject - addSearchCutomer

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了javascript OpenProject - addSearchCutomer相关的知识,希望对你有一定的参考价值。

function addSearchCustomer(){
	var customerSelect = document.getElementById('wp-new-inline-edit--field-customField1') || document.querySelector(".wp-inline-edit--field");
	var customerOptions = customerSelect.options;
	
	var searchCustomer = document.createElement("input");
	searchCustomer.id = "searchCustomer";
	searchCustomer.onchange = function() {
	    var customerCounter = 0;
		for (var i=1; i<customerOptions.length; i++) {
			if (customerOptions[i].text.indexOf(this.value) !== -1) {
				customerOptions[i].className = "";
				customerCounter++;
			} else
				customerOptions[i].className = "hide";
		}
		console.log("Ograniczono listę klientów do: " + customerCounter);
	};
	
	customerSelect.parentElement.parentElement.parentElement.parentElement.parentElement.appendChild(searchCustomer);
	customerSelect.onblur = 'this.size=10';
	
	customerSelect.size = 5;
	customerSelect.style.height = "5em";
	
	searchCustomer.focus();
}

以上是关于javascript OpenProject - addSearchCutomer的主要内容,如果未能解决你的问题,请参考以下文章

ubuntu16.04配置openproject开发环境步骤

云原生之Docker实战使用Docker部署OpenProject 项目管理平台

如何在Eclipse中订阅OpenProject事件?

IntelliJ IDEA如何导入Gradle项目

eclipse如何在workspace中关闭、打开project?

File文件