Can anyone help me ?
if i add a listener to a grid and use the record.get('dataIndex') it will return undefined ...
with this.getSelectionModel().getSelection()[0] i get the selected row, which i save in the parameter testsystem.
with the constructor of my pop up window i assign the row object to a new variable and try to get the data from the row.. but i didnt work :/
initcomponent: function { var config = {
boddyPadding: 10,
width: 1400,
title: 'Testsystem',
store: this.store,
emptyText: 'Currently, no test system avaiable!',
columns: [
{ header: 'System/Database', dataIndex: 'targetSystem', width: 130 },
{ header: 'Operating System', dataIndex: 'operatingSystem', width: 130 },
{ header: 'Version', dataIndex: 'version' },
{ header: 'Operating System Name', dataIndex: 'operatingSystemName', flex: 1 },
{ header: 'RAM', dataIndex: 'ram' },
{ header: 'Member Of', dataIndex: 'memberOf' },
{ header: 'Is Vm ?', dataIndex: 'isVM' },
{ header: 'MAC', dataIndex: 'mac' },
{ header: 'CPU Count', dataIndex: 'cpuCount' },
{ header: 'HDD', dataIndex: 'hdd' }
],
selModel: new Ext.selection.RowModel({mode: 'SINGLE'}),
forceFit: true,
listener: {
select: function(selModel, record, index, options){
alert(record.get('targestSystem'));
}
},
tbar: {
items: [
{
text: 'Refresh',
handler: function() {
this.store.reload();
},
scope: this
},
{ xtype: 'tbseparator'},
{
text: 'Edit',
handler: function(btn) {
new Inubit.Configuration.Edit({
testsystem: this.getSelectionModel().getSelection()[0],
modal: true,
listeners: {
'close' : function() {
this.store.reload();
},
scope: this
}
}).show(btn);
},
scope: this
}
]
},
dockedItems: [{
xtype:'pagingtoolbar',
store: this.store,
dock: 'bottom',
displayInfo: true,
displayMsg: '{0} - {1} of {2}',
emptyMsg: "No records to display",
}]
}
and the pop up window :
Ext.define('Inubit.Configuration.Edit', {
extend: 'Ext.window.Window',
title: 'Edit',
constructor : function(config) {
this.testsystem = config.testsystem,
this.name = this.testsystem.get('TargetSystem');
alert(this.name),
Ext.apply(this, Ext.apply(this.initialConfig));
Inubit.Configuration.Edit.superclass.initComponent.call(this);
} });
i am new to extjs and using 4.2