PDA

View Full Version : [OPEN] Ext.dataview.component.ListItem does not respect useComponents on record update



XASD
29 Oct 2012, 10:25 AM
If I use ListItem with component based layout -'useComponents:true', and try to modify corresponding record, list item dosen't get updated with new values.
But if I use standard approach with "itemTpl", new data get rendered properly respecting store update.

Small sample,store contains field 'name' in records:
1) list:


{
xtype: 'list',
store: 'mystore',
defaultType: 'myitemtype',
useComponents:true,
listeners:{
itemtap:function(s, index,target, record){
record.set('name','newname');
}
}

}


2) list item:


Ext.define('aaaaa', {
extend: 'Ext.dataview.component.ListItem',
xtype: 'myitemtype',
config: {
dataMap: {
getName: {
setHtml:'name'
},
},
name: true,
items: [
{ xtype: 'component', itemId: 'name' },
]
},
applyName: function () {
return this.child('#name');
}
});

It seems updateRecord() problem.

Thanks.

mitchellsimoens
29 Oct 2012, 11:01 AM
Thanks for the report! I have opened a bug in our bug tracker.

XASD
30 Oct 2012, 1:56 AM
Sincerely,I really missing simple declarative two-way binding infrastructure of knockoutjs.
It's binding framework is top notch IMHO-simple and expandable. I'm not sure it could be used in component based framework,but if it can-it should. Sorry,no offense.

Best wishes.

ampro
2 Dec 2012, 8:23 PM
Yes you can have two-way binding like Knockout ... it's called GluJS

http://www.conarrative.com/glujs.html

MVVM is way better than MVC and would make Sencha a serious killer framework! Dojo has already started down this path. Sencha's new class model would be a perfect fit for two way binding.