2 回答

TA貢獻(xiàn)1780條經(jīng)驗(yàn) 獲得超5個(gè)贊
您需要使用公司 ID 添加您的 select2 帖子數(shù)據(jù):
$("#selUser").select2({
ajax: {
url: "getData.php",
type: "post",
dataType: 'json',
delay: 250,
data: function (params) {
return {
searchTerm: params.term,
compId: $("#company_list").val() //here your company data
};
},
processResults: function (response) {
return {
results: response
};
},
cache: true
}
});
然后您可以獲取公司 ID$_POST["compId"]并將其添加到您在 get data.php 上的查詢(xún)中
- 2 回答
- 0 關(guān)注
- 178 瀏覽
添加回答
舉報(bào)