论坛首页 Web前端技术论坛

ExtJs Store的使用

浏览 3482 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (1) :: 隐藏帖 (0)
作者 正文
   发表时间:2010-01-25  
var store = new Ext.data.Store({
				proxy: new Ext.data.HttpProxy({url:'users.xml'}),
				reader: new Ext.data.XmlReader(
					{
						totalRecords:'TotalRecord',
						record:'User'
					},
					[
						{name:'Id'},
						{name:'Name'},
						{name:'Sex'}
					]
				),
				remoteSort: false
			});
			store.load({
				callback:function(r,o,s){
					for(var i = 0; i<r.length; i++ )
					{
						//alert(r[i].get("Name"));
					}
				}
			});
			var comBo = new Ext.form.ComboBox(
			 {
				allowBlank: false,
				valueField: "Id",
			    displayField: "Name",
			    width: 200,
			    maxHeight:250,
				typeAhead: true,
				triggerAction: 'all',
				emptyText: '===请选择===', 
				loadingText: '正在加载数据、请稍等......',
			    selectOnFocus: true,
			    forceSelection: true,
				editable: true,
				disabled: false,
			    store: store,
				mode: 'local',
				renderTo: 'form-cb',
				listeners:{select: getValue/*,blur: changeTagCatId*/}
			});	
			function  getValue(){
				alert(comBo.getValue());
			}

 

   发表时间:2010-02-01  
关于Store和Direct的使用,请大家围观最近的畅销书《Ext JS高级程序设计》
0 请登录后投票
   发表时间:2010-02-01  
这东西看官网实例就行了,还以为有什么特别的东西呢
0 请登录后投票
论坛首页 Web前端技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics