0
votes

This is not a problem, but rather a question that came into my mind. Me along with my friend were trying to disable RowEditing when a user doubleclicks a record/cell in the Ext.panel.Grid ( depending on some criteria ). I was looking into the API and was trying a way out. However, in the meanwhile when I googled one of the answers on Stackoverflow ( yeah here ) suggested to use the below event:

grid.on('beforeedit', function(editor, e) {
  if (e.colIdx === 0 && e.record.get('status') == 4)
  return false;
});

It worked !!! But when I referred back to ExtJS 4.2.0 API ( that's what we are using ), I didn't find the 'beforeedit' event on Ext.grid.Panel or it's parent Ext.panel.Table. The RowEditing plugin had the beforeedit event, but not the Grid. However, the older version 4.1.0 had the event for Ext.panel.Grid ( http://docs.sencha.com/extjs/4.1.0/#!/api/Ext.grid.Panel-event-beforeedit ), in fact beforeedit on Ext.panel.Grid was introduced since 4.1.0.

So, it's just the question which is bothering me that - Was the event deprecated so soon and still working? Or the API for 4.2.0 missed it? Or what was the reason that an event not defined in the API of the version am using, is still working !!! This will help me understand how the API is all documented and if I should rely on older versions for better documentation or whatever.

1

1 Answers

2
votes

The beforeedit event is not in the docs for Grid, because it is not an event on the Grid. It is an event on the Grid Editing Plugin.

The events from the Grid Editing Plugin are mixed-in to the grid at run-time, so if you use the Grid Editing Plugin, then the beforeedit event will appear to be on the Grid.

Not sure why they changed the docs between 4.1 and 4.2, but the difference doesn't really matter as the behaviour is the same.