不知道原因

动态通过接口加载地区的时候(以select形势展示),给其通过参数匹配每个option的value绑定一个默认地区时,写在$.post('接口',{},function(){})的function之外就生效。

生效的
   function changeArea1(area) {
            //所属地域
            fm.formEl("#income_account").empty();
            $.post('/Finance/rates.....', function (data) {
                fm.formEl("#income_account").bindSelect({hideValue: 'cityCode', showValue: 'cityName', data: data});
                fm.formEl("#income_account").val(area);
            }, 'json');
        }
不生效的
   function changeArea1(area) {
            //所属地域
            fm.formEl("#income_account").empty();
            $.post('/Finance/rates.....', function (data) {
                fm.formEl("#income_account").bindSelect({hideValue: 'cityCode', showValue: 'cityName', data: data});
            }, 'json');
  fm.formEl("#income_account").val(area);
        }

你可能感兴趣的:(不知道原因)