Hello,
here is more code for this problem:
The controller code:
PHP Code:
Ext.define('AM.controller.system.info', {
extend: 'Ext.app.Controller',
require: 'Ext.ux.RowExpander',
views: [ 'system.info', 'nav.system_details' ],
stores: [ 'nav.system_update' ],
models: [ 'nav.system_update' ],
init: function() {
this.control({
'system_info actioncolumn': {
show_pdf: this.onShowPDF
},
'system_info': {
close: function () {
Ext.getCmp('center_id').getActiveTab().close();
}
},
'system_info grid': {
//Bei diesem Event muss das Layout des Tabs neu gerechnet werden, wegen event. Srollbar...
groupclick: function(view){
view.up('tabpanel').getActiveTab().doLayout();
}
}
});
},
onShowPDF: function(view, cell, row, col, e){ console.log('TEST')
}
});
The view:
PHP Code:
Ext.Loader.setPath('Ext.ux', 'system/extjs/examples/ux/');
Ext.require([ 'Ext.ux.RowExpander' ]);
Ext.define('AM.view.system.info' ,{
extend: 'Ext.tab.Panel',
alias : 'widget.system_info',
iconCls : 'settings',
height: 200,
title : 'Systeminformation',
activeTab: 0,
initComponent: function() {
this.items = [
{
xtype : 'system_details',
title : 'Allgemein',
nameColumnWidth : 170,
iconCls : ''
},
{
xtype : 'gridpanel',
title : 'Updateverlauf',
store : 'nav.system_update',
columns : [
{
text : 'Build kalkTOOL',
flex : 1,
dataIndex : 'prg_version',
summaryType : 'count',
summaryRenderer : function(value) {
return ((value === 0 || value > 1) ? '' + value + ' Patches' : '1 Patch');
}
},
{
text : 'Kategorie',
dataIndex : 'prg_kategorie'
},
{
text : 'Datum',
dataIndex : 'prg_time_real',
renderer : Ext.util.Format.dateRenderer('d.m.Y H:i')
},
{
xtype : 'actioncolumn',
width : 20,
items : [
{
icon : 'system/icons/page_white_acrobat.png',
handler : function(grid, rowIndex, colIndex) {
this.fireEvent('show_pdf', this, grid, rowIndex, colIndex);
}
}
]
}
],
viewConfig :
{
stripeRows : true,
loadingText : 'Daten werden geladen...'
},
// toFIX Dieses Plugin ist defekt in 4.2.0 beta
//
plugins : [
{
ptype : 'rowexpander',
rowBodyTpl : ['<p><b>Informationen zum Patch:<br><br></b> {prg_text}</p>'
]
}
]
}
];
this.callParent(arguments);
}
});
The store:
PHP Code:
Ext.define('AM.store.nav.system_update',
{
extend : 'Ext.data.Store',
model : 'AM.model.nav.system_update',
autoLoad : true,
groupDir : 'DESC',
groupField : 'prg_time_year',
proxy :
{
type : 'ajax',
url : 'prg/system_updateverlauf/system_updateverlauf_db.php',
reader :
{
root : 'data',
totalProperty : 'count',
id : 'id'
}
}
});
And the model:
PHP Code:
Ext.define('AM.model.nav.system_update',
{
extend : 'Ext.data.Model',
fields : [
{
name : 'id',
type : 'int'
},
{
name : 'prg_version'
},
{
name : 'prg_time_real',
type : 'date',
dateFormat : 'Y-m-d H:i:s'
},
{
name : 'prg_time_year',
convert : function(value, record) {
prg_time_year = record.data.prg_time_real.getFullYear();
return prg_time_year;
}
},
{
name : 'prg_kategorie'
},
{
name : 'prg_text'
},
{
name : 'prg_document_path'
}
],
idProperty : 'id'
});
The os is windows 7 and browser is chrome 23.0.1271.97 m.
Thanks!
Michi