PDA

View Full Version : Desperately trying to get TileView working in 4.2.3 grid



Jangla
2 Apr 2015, 4:35 AM
Our older 4.1.1 code got the job done by using the TableChunker....which is gone in 4.2.x - and this extension: http://harrydeluxe.github.io/extjs-ux/example/grid/tileview.html

The great thing about that extension is that it can call getAdditionalData on each record as it transitions to tile mode so you can manipulate the data for your other view.

4.2.3 scrapped all that and has, as far as I can tell, no equivalent.

So far, I've managed to get my code to the point that it's sort of working but I still can't figure out how to have getAdditionalData (or something similar) called on each record when changing view.

Here's the feature definition (abridged) as it stands:



Ext.create('Ext.ux.grid.feature.Tileview', {
viewMode: '',
id : 'gridTileView',
tableTpl: [
'{%',
'var view=values.view,tableCls="' + Ext.baseCSSPrefix + '" + view.id + "-table ' + Ext.baseCSSPrefix + 'grid-table";',
'values.fullWidth',
'%}',
'<table id="{view.id}-table" class="{[tableCls]}" border="0" cellspacing="0" cellpadding="0" style="{tableStyle}" {ariaTableAttr}>',
'{[view.renderColumnSizer(out)]}',
'{[view.renderTHead(values, out)]}',
'{[view.renderTFoot(values, out)]}',
'<tbody id="{view.id}-body" {ariaTbodyAttr}>',
'{%',
'view.renderRows(values.rows, values.viewStartIndex, out);',
'%}',
'</tbody>',
'</table>',
{
priority: 0
}
],
viewTpls : {
tileView: ['<tpl if="view.tileViewFeature.viewMode==\'tileView\'">\
{%\
var dataRowCls = values.recordIndex === -1 ? "" : " ' + Ext.baseCSSPrefix + 'grid-data-row";\
var columnValues = values.view.tileViewFeature.getColumnValues(values.columns, values.record);\
%}\
<tr role="row" {[values.rowId ? ("id=\\"" + values.rowId + "\\"") : ""]} \
data-boundView="{view.id}" \
data-recordId="{record.internalId}" \
data-recordIndex="{recordIndex}" \
class="tileview {[values.itemClasses.join(" ")]} {[values.rowClasses.join(" ")]}{[dataRowCls]}" \
{rowAttr:attributes} tabIndex="-1">\
<td role="gridcell" class="{tdCls} x-grid-tdx ux-explorerview-detailed-icon-row" {tdAttr} id="{[Ext.id()]}">\
//// etc etc etc
</td>\
</tr>\
<tpl else>\
{%this.nextTpl.applyOut(values, out, parent);%}\
</tpl>',
{
priority: 0
}
]
}
})


Any help on this greatly appreciated as I'm reaching the end of my tether with this 4.2.x upgrade :(

slemmon
13 Apr 2015, 12:59 PM
Hi,

I'm sorry you're having difficulty with the upgrade. I'm afraid user extensions and a tiled grid view is not supported by the framework.

Best of luck with the extension!