1,使用angular動態取得位址資訊並自動產生位址下拉清單:
程式碼如下:
<select name="graduated_province" ng-model="graduated_province" ng-options="pro.area_id as pro.area_name for pro in province" ng-change="areaChoose('city')">
<option value="" label="请选择" selected="selected">请选择</option>
</select>
<select name="graduated_city" ng-model="graduated_city" ng-options="city.area_id as city.area_name for city in city" ng-change="areaChoose('district')">
<option value="" label="请选择" selected="selected">请选择</option>
</select>
<select name="graduated_district" ng-model="graduated_district" ng-options="dist.area_id as dist.area_name for dist in district">
<option value="" label="请选择" selected="selected" >请选择</option>
</select>
效果如下:
那麼問題來了,因為是透過ajax取得位址資料然後angular產生的清單,所以在
這樣的網路情況下,如果你在生成下拉框之前點擊這個即將生成的下拉框,會出現:
這樣的情況.
所以我想問下有什麼辦法能夠使下拉框能夠動態擴展大小?