亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

extjs 取數據問題

extjs 取數據問題

料青山看我應如是 2018-12-06 14:35:56
版本3.0 后臺代碼: public JsonResult City() { return Json("{\"data\":[{\"id\":1,\"name\":\"北京\"}]}", JsonRequestBehavior.AllowGet); } js: Ext.onReady(function () { //創建市數據源 var combocitystore = new Ext.data.Store({ //設定讀取的地址 proxy: new Ext.data.HttpProxy({ url: 'combobox/City' }), //設定讀取的格式 reader: new Ext.data.JsonReader({ root: 'data' }, [ { name: "id" }, { name: "name"}]) }); //創建市Combobox var comboboxcity = new Ext.form.ComboBox({ id: 'comboboxcity', fieldLabel: '市', width: 120, store: combocitystore, displayField: 'name', valueField: 'id', triggerAction: 'all', emptyText: '請選擇...', allowBlank: false, blankText: '請選擇市', editable: false, mode: 'local', //該屬性和以下方法為了兼容ie8 listeners: { 'render': function () { combocitystore.load(); alert(combocitystore.getCount()); } } }); //----------------------下拉列表結束----------------------// //表單 var form = new Ext.form.FormPanel({ frame: true, title: '表單標題', style: 'margin:10px', items: [comboboxcity, comboareacity] }); //窗體 var win = new Ext.Window({ title: '窗口', width: 476, height: 374, resizable: true, modal: true, closable: true, maximizable: true, minimizable: true, buttonAlign: 'center', items: form }); win.show(); ---自己寫的ajax是正常的 $.ajax({ type: "post", url: 'combobox/City', data: null, dataType: "json", success: function (data) { var d = $.parseJSON(data); } }); }); 原因combocitystore 為null 是什么原因呢? 腳本無錯誤
查看完整描述

1 回答

?
呼如林

TA貢獻1798條經驗 獲得超3個贊

extjs
查看完整回答
反對 回復 2018-12-09
  • 1 回答
  • 0 關注
  • 445 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號