像这种,model里面属性为对象的,可以这么玩
方法一:
Ext.define('App.model.Model', { extend: 'Ext.data.Model', // requires: [ // 'App.model.Task' // ], fields: [ {name: 'task' ,type:'auto'}, {name: 'task.createTime' ,mapping:'task.createTime'}, {name: 'processInstance'}, {name: 'processDefinition'}, {name: 'title', type: 'string'} ] });
{ header: '创建时间', dataIndex: 'task.createTime', align: 'center', flex:1}
参考
http://stackoverflow.com/questions/10500367/extjs-model-fields-with-subfields 写道
Thanks to @sha - here is the answer I needed :)
Model
fields:[
{name: 'id', type: 'int'},
{name: 'title', type: 'string'},
{name: 'description', type: 'string'},
{name: 'priority', type: 'auto'},
{name: 'code', type: 'string', mapping:'priority.code'},
{name: 'createdBy', type: 'auto'},
]
Gird Panel
columns:[
{header:'Title', dataIndex:'title', flex:1},
{header:'Description', dataIndex:'description'},
{header:'Priority', dataIndex:'code'}
],
Model
fields:[
{name: 'id', type: 'int'},
{name: 'title', type: 'string'},
{name: 'description', type: 'string'},
{name: 'priority', type: 'auto'},
{name: 'code', type: 'string', mapping:'priority.code'},
{name: 'createdBy', type: 'auto'},
]
Gird Panel
columns:[
{header:'Title', dataIndex:'title', flex:1},
{header:'Description', dataIndex:'description'},
{header:'Priority', dataIndex:'code'}
],
如果,属性是集合的,就用hasMany吧,
http://stackoverflow.com/questions/14756012/extjs-nested-model 写道
Ext.define("ResponseModel",{
extend:'Ext.data.Model',
fields:[],
hasMany:[{
model:'Sromain',
name:'sromain'},{
model:'Branch',
name:'branches'}]});
Ext.define("Sromain",{
extend:'Ext.data.Model',
fields:['corporation','dbName','prijmyCelk','nakladyCelk','ziskCelk','neuhrVydCelk','neuhrPrijCelk','dph'],
belongsTo:'ResponseModel'});
Ext.define("Branch",{
extend:'Ext.data.Model',
fields:['branch_name','branch_code','strediskoprijmyCelk','strediskonakladyCelk','strediskoziskCelk','strediskoneuhrVydCelk','strediskoneuhrPrijCelk','streddphCelk'],
belongsTo:'ResponseModel'});
var firstRecord = store.getAt(0);
console.log(firstRecord.branches());
console.log(firstRecord.sromain());
相关推荐
Ext.Panel API翻译 -------Window属性
NULL 博文链接:https://hanxs8866-163-com.iteye.com/blog/1174152
Ext4.1 没其他功能,只是简单的将model,store到加controler管理,getmoudles()根据store里的id字段返回相应权限模块,自定义SysmanagerApp模块的内容是网上随便找的,报错正常,可以打开,只为演示用嘛 另外没有其他...
EXT dojochina Ext类实例属性.rar EXT dojochina Ext类实例属性.rar
EXT组件一些属性与方法(MessageBox)[文].pdf
包含一些EXT平时使用中常遇到的问题,以及解决方案
很全,很强大的Ext常用属性总结让你写extjs代码时游刃有余的感觉。
ext2文件扩展属性讲解[借鉴].pdf
详细介绍Ext按钮的属性,并将相应的图片与之一一对应!
用Ext实现报表中的核心问题解决方案, X和Y轴注释, 已经竖着现在Y轴名称
Ext的面向对象实例: 1.命名空间 2.类实例属性 3.类实例方法 4.类静态方法 5.构造方法 6.类继承 7.类实例方法重写 8.命名空间别名 9.类别名 10.事件队列
Extjs & Ext.net中的一些属性
常用的知识\Ext_Tree属性方法.txt ,对于ext建树很有帮助
1. Ext.form.NumberField 2. Ext.form.TextArea 3. Ext.form.TriggerField 4. Ext.form.DateField 5. Ext.form.ComboBox 6. Ext.form.TimeField
EXT中文EXT中文EXT中文EXT中文EXT中文EXT中文EXT中文EXT中文EXT中文EXT中文EXT中文EXT中文EXT中文EXT中文EXT中文EXT中文EXT中文EXT中文EXT中文EXT中文EXT中文EXT中文EXT中文EXT中文EXT中文EXT中文EXT中文EXT中文EXT...
asdext extext extext extext extext extext extext extext extext extext extext extext extext extext ext
ie9不支持ext对象的问题
严重: Exception starting filter SolrRequestFilter org.apache.solr.common.SolrException: ...2、解压后找到,ext文件夹,把这个文件夹下面的所有jar包复制到你的tomcat下面的lib里面。 然后重启启动solr服务器。
详细介绍了ext2文件系统在内核中的布局,以及ext2的基本数据结构和功能介绍,同时详细的讲解了ext2文件系统中的扩展属性,从基本数据结构入手,剖析了关于扩展属性的详细操作流程。
ext资料 ext资料 ext资料 ext资料 ext资料