easyUI combobox二级联动修改页面自动加载已选选项

方案:使用延迟加载,触发一级控件的select方法,加载二级控件

$(function () {
    $("body").layout();
    $('#form input.easyui-numberbox').numberbox();
    customerCombo('ccbi_ci_name');//客户名称
    
    setTimeout(function () {
        $('#ccbi_ci_name').combobox("select","${(cardBillingInfo.ccbi_ci_name)!}");
    }, 200);
});

function customerCombo(id) {
    $('#' + id).combobox({
        url: "${path}/customer/info_queryCustomerCombo.do",
        editable: false,
        valueField: 'ci_id',
        textField: 'ci_name',
        onSelect: function (data) {
            $('#ccbi_cci_id').combobox({
                url: "${path}/credit/cardInfo_queryCardInfoCombo.do?ci_id=" + data.ci_id,
                editable: false,
                width: 308,
                valueField: 'cci_id',
                textField: 'cci_bank_name'
            });
        }
    });
}

你可能感兴趣的:(JavaEE-Web前台,Web前端-Easy,UI)