我有個審批表,需要有審批人 可以選擇公司員工 表單屬性控件是下拉多選
url:/app/admin/staff/select?format=select
但是只有10個員工可供選擇,這個沒有加限制,不是應該是所有的員工數(shù)據(jù)嗎
// 字段 用戶ID user_id 分頁搜索單選
layui.use(["jquery", "xmSelect", "popup"], function() {
let initValue = layui.$("#user_id").attr("value");
layui.xmSelect.render({
el: "#user_id",
name: "user_id",
initValue: initValue,
//配置搜索
filterable: true,
radio: true,
//配置遠程分頁
paging: true,
pageRemote: true,
//數(shù)據(jù)處理
remoteMethod: function(val, cb, show, pageIndex){
//val: 搜索框的內容, 不開啟搜索默認為空, cb: 回調函數(shù), show: 當前下拉框是否展開, pageIndex: 當前第幾頁
layui.$.ajax({
url: "/app/admin/sr-user/select?format=selectPage",
dataType: "json",
data: {name: val,page:pageIndex},
success: function (d) {
cb(d.data, Math.ceil(d.count / 10))
}
});
}
});
});