[ExtJS]紧急求助:PropertyGrid的数据怎么穿到后台保存...

敛我半世癫狂 2010-08-03 11:24:51
var CustomerProperty = new Ext.grid.PropertyGrid({
title: "属性",
region: 'east',
collapseMode: 'mini',
collapsible: true,
split: true,
width: 225, // give east and west regions a width
minSize: 175,
maxSize: 400,
margins: '1 1 1 1',
layout: 'fit',
closable: true,
// hidden: true,
source: {
"上市公司": true,
"公司类型": "11",
"公司网址": "111",
"经济类型": "11",
"成立时间": new Date(Date.parse('10/15/2006'))
},
tbar: ['-', {
text: '保存',
iconCls: 'bi_save',
handler: function() {
alert(输出'公司类型'的值);
}
}]
});


如上图,怎么在点保存时候获取某个属性的值?我用了 CustomerProperty.source['公司类型'] 但是alert出来的始终是'11'
...全文
509 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhaoxiaozhao0 2010-08-03
  • 打赏
  • 举报
回复
这个问题很纠结1
zoujp_xyz 2010-08-03
  • 打赏
  • 举报
回复
在afteredit事件中写一个异步请求提交到后台
Ext.Ajax.request({
url:"",......
})
zoujp_xyz 2010-08-03
  • 打赏
  • 举报
回复
属性grid不用专门的按钮来保存的。
只要值改变了就会调用afteredit事件
你可以在afteredit事件中alert一下。主要它的一些参数
------------------
afteredit : ( Object e )
Fires after a cell is edited. The edit event object has the following properties <br /> <ul style="padding:5px;paddin...
Fires after a cell is edited. The edit event object has the following properties
* grid - This grid
* record - The record being edited
* field - The field name being edited
* value - The value being set
* originalValue - The original value for the field, before the edit.
* row - The grid row index
* column - The grid column index
grid.on('afteredit', afterEdit, this );
function afterEdit(e) {
// execute an XHR to send/commit data to the server, in callback do (if successful):
e.record.commit();
};
敛我半世癫狂 2010-08-03
  • 打赏
  • 举报
回复
还想补充个问题:怎么在Property里加Combox

如:公司类型 选项:aa,bb,cc
敛我半世癫狂 2010-08-03
  • 打赏
  • 举报
回复
呵呵,自己解决了。

alert(CustomerProperty.getSource()['公司类型'])

87,921

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧