PDA

View Full Version : Ext Grid Plugin (expandable row) does not work even on sencha live demo :(



raja.ecom
13 Oct 2011, 2:03 AM
http://dev.sencha.com/deploy/ext-4.0.2a/examples/grid/grid-plugins.html

When I go to the link above and click the plus (+) sign then desired row doesn't expand, it throws Error: this.view is undefined
Source File: http://dev.sencha.com/deploy/ext-4.0.2a/examples/ux/RowExpander.js?_dc=1318499729815
Line: 179

Could anyone help me in this regard ?

I have to use this plugin for nested editable grids. I appreciate any help in this regard.

skirtle
13 Oct 2011, 3:46 AM
Confirmed.

If I were you I'd wait for 4.0.7 to be released before spending any time on this issue.

lucasguaru
13 Oct 2011, 3:56 AM
The error happens on toggleRow function, on RowExpander.js


toggleRow : function(rowIdx) {
var rowNode = this.view.getNode(rowIdx), row = Ext.get(rowNode), nextBd = Ext.get(row).down(this.rowBodyTrSelector), record = this.view.getRecord(rowNode);
if (row.hasCls(this.rowCollapsedCls)) {
row.removeCls(this.rowCollapsedCls);
nextBd.removeCls(this.rowBodyHiddenCls);
this.recordsExpanded[record.internalId] = true;
this.view.fireEvent('expandbody', rowNode, record, nextBd.dom);
} else {
row.addCls(this.rowCollapsedCls);
nextBd.addCls(this.rowBodyHiddenCls);
this.recordsExpanded[record.internalId] = false;
this.view.fireEvent('collapsebody', rowNode, record, nextBd.dom);
}
this.view.up('gridpanel').invalidateScroller();
}

Try to debug the method below when it tries to set the view on the bottom.


onGridAfterLayout = function() {
var grid = this.getCmp(), view, viewEl;
if (!grid.hasView) {
this.getCmp().on('afterlayout', this.onGridAfterLayout, this, {
single : true
});
} else {
view = grid.down('gridview');
viewEl = view.getEl();
if (this.expandOnEnter) {
this.keyNav = Ext.create('Ext.KeyNav', viewEl, {
'enter' : this.onEnter,
scope : this
});
}
if (this.expandOnDblClick) {
view.on('itemdblclick', this.onDblClick, this);
}
this.view = view;
}
}

mitchellsimoens
13 Oct 2011, 6:35 AM
Confirmed.

If I were you I'd wait for 4.0.7 to be released before spending any time on this issue.

Just looked at 4.0.6 and it works fine. 4.0.7 is in some testing before it is released so it will be just around the corner.

hoanghuu
14 Oct 2011, 6:39 PM
http://dev.sencha.com/deploy/ext-4.0.2a/examples/grid/grid-plugins.html

When I go to the link above and click the plus (+) sign then desired row doesn't expand, it throws Error: this.view is undefined
Source File: http://dev.sencha.com/deploy/ext-4.0.2a/examples/ux/RowExpander.js?_dc=1318499729815
Line: 179

Could anyone help me in this regard ?

I have to use this plugin for nested editable grids. I appreciate any help in this regard.

You can override toogleRow function by code:


toggleRow: function(rowIdx) {
var rowNode = this.cmp.view.getNode(rowIdx),
row = Ext.get(rowNode),
nextBd = Ext.get(row).down(this.rowBodyTrSelector),
record = this.cmp.view.getRecord(rowNode);

if (row.hasCls(this.rowCollapsedCls)) {
row.removeCls(this.rowCollapsedCls);
nextBd.removeCls(this.rowBodyHiddenCls);
this.recordsExpanded[record.internalId] = true;
this.cmp.view.fireEvent('expandbody', rowNode, record, nextBd.dom);
} else {
row.addCls(this.rowCollapsedCls);
nextBd.addCls(this.rowBodyHiddenCls);
this.recordsExpanded[record.internalId] = false;
this.cmp.view.fireEvent('collapsebody', rowNode, record, nextBd.dom);
}
this.cmp.view.up('gridpanel').invalidateScroller();
}

raja.ecom
18 Oct 2011, 4:39 AM
Thank you very much everyone for your time and consideration I appreciate your effort, specially @hoanghuu (http://www.sencha.com/forum/member.php?323712-hoanghuu) answer solved my problem :).