ext gridpanel 动态添加

1. 需要新建一个record

 //第一步,create() 返回一个 Record 的子类(定义了数据表现)
02             var Person = Ext.data.Record.create([ //用对象数组指定每个字段名
03                 {name:'name'},{name:'email'} //name 属性指定每个字段名
04             ]);
05               
06             //通过前面 create() 返回的 Person 类创建 record 实例
07             var record = new Person({//传入一个对象作为第一个参数,注意属性名对应
08                 name:'james',
09                 email:'james@google.com'
10             },2009); //第二个参数指定记录的标识 ID,未指定 ID 则为你用整数进行编号
11               
12             //验证效果,只取 id 和其中的 email 属性
13             alert('id:' + record.id +", email:" + record.get('email'));
14 
15 
16                /************************************************************/           
17 
18                 var record = new Ext.data.Record({//传入一个对象作为第一个参数
19                 name:'james',
20                 email:'james@google.com'
21             });
22             //验证效果,只取 id 和其中的 email 属性
23             alert('id:' + record.id +", email:" + record.get('email'));

 

2中方法都可以

我试用了第二种,

 

 

2. 在ds中 add(records) 把创建的record加入

 

var record = new Ext.data.Record({
			id: 1,
			condition_name: '频次',
			condition_detail: '频次 > 3'			
		},1);
maker.conditionDetailDs.add(record);
 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值