PDA

View Full Version : interceptMouse missing from GroupingView in ext 3.3



ttbgwt
15 Oct 2010, 8:51 AM
We were using the following code to detect when the grouping row was clicked, and if an icon on the row was clicked. If an icon was clicked, then we didn't allow the group to expand or collapse.



new Ext.grid.GroupingView({
groupTextTpl: '<table cellspacing="0" cellpadding="0">' +
'<tr>' +
'<td ' + (hasFullPermission ? 'qtip="Click on group name to edit." ' : '') + 'id="{[values.rs[0].data.itemGroupId]}-{[values.rs[0].data.itemGroupSequence]}" class="editableItemGroup" style="padding-right:20px;width:auto">{[values.rs[0].data.itemGroup]}</td>' +
(hasFullPermission ? (
'<td><div qtip="Move Down" style="width: 16px" class="move-down-icon" onclick="Ccs.olg.shiftItemGroup(\'{[values.rs[0].data.itemGroupId]}\',\'DOWN\'); return false;" /></td>')
: '') +
'</tr>' +
'</table>',

interceptMouse : function(e){
var cancelEvent = (e.getTarget('.editableItemGroup', this.mainBody) ||
e.getTarget('.search-icon', this.mainBody) ||
e.getTarget('.delete-icon', this.mainBody) ||
e.getTarget('.selected-icon', this.mainBody) ||
e.getTarget('.deselected-icon', this.mainBody) ||
e.getTarget('.move-up-icon', this.mainBody) ||
e.getTarget('.move-down-icon', this.mainBody));
if (!cancelEvent){
return this.constructor.prototype.interceptMouse.call(this, e);
}
}


We upgraded to ext 3.3 and we searched the forums and found out that the interceptMouse was removed from the grouping view but replaced with processEvent so we tried to use it. Problem is we don't know how to determine if an icon was clicked now rather than somewhere else on the row? Any suggestions?



processEvent: function(e){
var cancelEvent = (e.getTarget('.editableItemGroup', this.mainBody) ||
e.getTarget('.search-icon', this.mainBody) ||
e.getTarget('.delete-icon', this.mainBody) ||
e.getTarget('.selected-icon', this.mainBody) ||
e.getTarget('.deselected-icon', this.mainBody) ||
e.getTarget('.move-up-icon', this.mainBody) ||
e.getTarget('.move-down-icon', this.mainBody));
if (!cancelEvent){
return this.constructor.prototype.processEvent.call(this, e);
}
}

ttbgwt
15 Oct 2010, 9:04 AM
Figured it out:



processEvent: function(name,e){
if (hasFullPermission)
{
var cancelEvent = (e.getTarget('.editableItemGroup', this.mainBody) ||
e.getTarget('.search-icon', this.mainBody) ||
e.getTarget('.delete-icon', this.mainBody) ||
e.getTarget('.selected-icon', this.mainBody) ||
e.getTarget('.deselected-icon', this.mainBody) ||
e.getTarget('.move-up-icon', this.mainBody) ||
e.getTarget('.move-down-icon', this.mainBody));
if (!cancelEvent){
return this.constructor.prototype.processEvent.call(this,name,e);
}
}
}