I am using ExtJS 4.1. I am using MVC feature. I have defined all my controls in View and reply on Controller for event handling. I want to add some feature to the grid. I am not sure at what place I can define the feature. Is it possible to define a feature with view?
In this case by feature I mean grouping feature
Ext.define('PA.view.OptionsView', {
extend: 'Ext.panel.Panel',
alias: 'widget.optionsview',
id: 'option-panel',
title: 'Options',
// feature: --- Where can i define the feature in order to use it
items: [{
xtype: 'grid',
id: 'columnGrid',
flex: 1,
hideHeaders: true,
store: 'myStore',
columns: [
{
header: 'Columns',
sortable: false,
dataIndex: 'DisplayName'
},
{
header: 'Column2',
sortable: false,
dataIndex: 'DisplayName2'
}
]
}]
});
If I define the group feature like this:
features: [{
ftype: 'grouping',
groupHeaderTpl: '{columnName}: {name} ({rows.length} Item{[values.rows.length > 1 ? "s" : ""]})',
hideGroupedHeader: true,
startCollapsed: true,
id: 'restaurantGrouping'
}],
then, I am not able to enable/disable the group as those property/methods are not available as shown in below image:
if I define feature like this:
var groupingFeatureColumn = Ext.create('Ext.grid.feature.Grouping', {
groupHeaderTpl: '{name} ({rows.length} Item{[values.rows.length > 1 ? "s" : ""]})',
hideGroupedHeader: true,
startCollapsed: false,
id: 'measureGrouping-column'
});
Then I can enable disable the feature as those property are available as shown below