PDA

View Full Version : Problem with data.view



Skynet-tx
19 May 2013, 7:45 AM
Hello! I Have a problem with Ext.view.View
snapshot of my desktop

43866
In my page i use a dataview with XTemplate. After, i updated my dataview and my table from template is duplicated. My code:

{
xtype: 'dataview',
tpl: new Ext.XTemplate (http://docs.sencha.com/extjs/4.1.3/#!/api/Ext.XTemplate)(
'<table>',
'<thead>',
'<tr>',
'<th>Name</th>',
'<th>Date</th>,
'</thead>',
'<tbody>',
'<tpl for=".">',
'<tr>','<td>{name}</td>',
'<td>{date}</td>',
'</tpl>',
'<tbody>',
'</table>'),
itemSelector:'td'
}
What is the problem of duplication . After update dataview is creating two tables. One with values, second - empty. :-/

Skynet-tx
20 May 2013, 12:27 AM
I have a problem with dataview who contains the data.
Section, which doesn't exists in tpl is duplicated! In this instance - test. Maybe it's a bug of Extjs?

var datat = [
{ src:'http://www.sencha.com/img/20110215-feat-drawing.png', caption:'Drawing & Charts' },
{ src:'http://www.sencha.com/img/20110215-feat-data.png', caption:'Advanced Data' },
{ src:'http://www.sencha.com/img/20110215-feat-html5.png', caption:'Overhauled Theme' },
{ src:'http://www.sencha.com/img/20110215-feat-perf.png', caption:'Performance Tuned' }
];

var imageTpl = new Ext.XTemplate(
'<p>test:<p>',
'<tpl for=".">',
'<div style="margin-bottom: 10px;" class="thumb-wrap">',
'<img src="{src}" />',
'<br/><span>{caption}</span>',
'</div>',
'</tpl>'
);

Ext.create('Ext.view.View', {
data: datat,
tpl: imageTpl,
itemSelector: 'div',
emptyText: 'No images available',
renderTo: Ext.getBody()
});

Skynet-tx
20 May 2013, 12:32 AM
Result:

test:

http://www.sencha.com/img/20110215-feat-drawing.png
Drawing & Charts
http://www.sencha.com/img/20110215-feat-data.png
Advanced Data
http://www.sencha.com/img/20110215-feat-html5.png
Overhauled Theme
http://www.sencha.com/img/20110215-feat-perf.png
Performance Tuned
test: