In 4.1 the Row Body Feature could be added to a grid using a buffered store. This now appears to be broken in the 4.2 Beta.
Here's my test code:
Code:
<!DOCTYPE html />
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Row Body Feature Test</title>
<link rel="stylesheet" type="text/css" href="Lib/ExtJS/resources/css/ext-all.css"/>
<script type="text/javascript" src="Lib/ExtJS/ext-all-debug-w-comments.js"></script>
<script type="text/javascript">
Ext.Loader.setConfig({ enabled: true })
Ext.require([
'Ext.grid.*',
'Ext.data.*',
'Ext.util.*'
]);
Ext.application(
{
name: 'Test',
launch: function ()
{
Ext.define('ReviewsModel',
{
extend: 'Ext.data.Model',
fields: [{ name: 'summary', type: 'string' }]
});
var ReviewsStore = Ext.create('Ext.data.Store',
{
model: 'ReviewsModel',
autoLoad: true,
buffered: true,
pageSize: 10,
proxy:
{
type: 'ajax',
url: 'ReviewLoader.aspx',
method: 'post',
reader:
{
type: 'json',
root: 'rows',
totalProperty: 'totalCount'
}
}
});
var reviewGrid = Ext.create('Ext.grid.Panel',
{
width: 700,
height: 500,
store: ReviewsStore,
loadMask: true,
features: [{
ftype: 'rowbody',
getAdditionalData: function (data, rowIndex, record, orig)
{
var headerCt = this.view.headerCt,
colspan = headerCt.getColumnCount();
return {
rowBody: '<div style="padding: 1em">cheese</div>',
rowBodyCls: "my-body-class",
rowBodyColspan: colspan
};
}
}],
columns: [{ header: "Title", dataIndex: 'summary', flex: 1 }]
});
Ext.create('Ext.container.Viewport',
{
layout: 'fit',
items: reviewGrid
});
}
});
</script>
</head>
<body>
</body>
</html>
In the ReviewLoader.aspx file I have it hardcoded to simply return the following JSON:
Code:
{'totalCount':'1','rows':[{'summary':'Some test content for the first line'}]}
If the "buffered: true" attribute of the store is commented out, then everything starts working again.