Ext多选框在数据源加载后全选。

点击已通知人员

Ext多选框在数据源加载后全选。

重新加载数据源并全选当前列

Ext多选框在数据源加载后全选。

代码如下

数据源代码:

var store = new Ext.data.Store({
				autoLoad : {// 自动加载
					params : {// 属性,相当于可以在action中使用request.getParamet("属性");取值
						start : 0,
						limit : 20,
						departmentcode : orgnum,	//组织编码
						personname : jQuery('#personname').val()	//人员姓名
					}
				}, 
				// 读取服务器端的数据
				reader : new Ext.data.JsonReader({
							totalProperty : "results",// 获得总的记录数量
							root : "items",// 获得数据集合
							// 设置字段(相当于JAVA对象的属性)
							fields : fields
						}),
				// 远程代理,AJAX到服务器端
				proxy : new Ext.data.HttpProxy({
							url : 'caseTask.do?method=getPersonList'
						})
			})
 

重新加载并全选

//已通知人员查询
	function selectSearchInfos() {
		store.load({
					params : {
						start : 0,
						limit : 20,
						orgnum : orgnumHidden.getValue(),
						personname : search_text.getValue(),
						personid : jQuery('#personid').val(),
						isSelectPerson : "yes",
						caseId : jQuery("#caseId").val()
					},
					// 以后每次load数据时,都会默认选中
					callback: function(records, options, success){
					 	sm.selectRecords(records, true);// 以后每次load数据时,都会默认选中
			      }
					
				});
	}
 

你可能感兴趣的:(jquery,function,服务器,ext,callback,autoload)