bug
This commit is contained in:
@ -62,7 +62,8 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD
|
|||||||
selelct_4.val('').trigger("change");
|
selelct_4.val('').trigger("change");
|
||||||
|
|
||||||
|
|
||||||
//TODO 代码有冲突
|
// Initialize job dropdown with all jobs
|
||||||
|
onValueChange();
|
||||||
key = setInterval(() => {
|
key = setInterval(() => {
|
||||||
// console.log(document.getElementById('objUserName'))
|
// console.log(document.getElementById('objUserName'))
|
||||||
if ($('#objUserId').val() != old) {
|
if ($('#objUserId').val() != old) {
|
||||||
@ -172,9 +173,17 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD
|
|||||||
|
|
||||||
function onValueChange() {
|
function onValueChange() {
|
||||||
// console.log($('#objUserId').val())
|
// console.log($('#objUserId').val())
|
||||||
$.post(ext.contextPath + "/user/getJsonJobByUser.do?userId=" + $('#objUserId').val(), function (data) {
|
$.get(ext.contextPath + "/user/getJsonJob.do", function (data) {
|
||||||
|
// Transform data to Select2 format: {id, text}
|
||||||
|
var transformedData = [];
|
||||||
|
$.each(data, function(index, item) {
|
||||||
|
transformedData.push({
|
||||||
|
id: item.id,
|
||||||
|
text: item.name
|
||||||
|
});
|
||||||
|
});
|
||||||
$("#jobId").select2({
|
$("#jobId").select2({
|
||||||
data: data,
|
data: transformedData,
|
||||||
cache: false,
|
cache: false,
|
||||||
placeholder: '请选择',//默认文字提示
|
placeholder: '请选择',//默认文字提示
|
||||||
// allowClear: true,//允许清空
|
// allowClear: true,//允许清空
|
||||||
|
|||||||
Reference in New Issue
Block a user