fastadmin 關於selectpage查詢及二級聯動
阿新 • • 發佈:2020-07-21
<input id="c-name" data-rule="required" data-source="user/user/group" data-params='{"custom[group_id]":"1"}' data-field="nickname" class="form-control selectpage" name="row[name]" type="text" value="">
====================
data-params='{"custom[group_id]":"1"}'
條件查詢只需加入上面這句程式碼
==============================
二級聯動 :
$("#c-cp_trans_ids").data("params", function (obj) { return {custom: {type: $("#c-cp_trans_id").val()}}; });
第二種方法:
$(document).on("change", "#c-category1", function () { $.post("mall/goods/brands/selectpage",{custom: {catId: $(this).val()},},function(result){ var i = $('#c-brandId').val(); $('#c-brandId').selectPageData(result.list); $('#c-brandId').val(i); $('#c-brandId').selectPageRefresh(); }); });
=================
不成功,在研究.....