PDA

View Full Version : Custom extension breaks when upgrading to ExtJS 3



legrego
19 Jul 2010, 4:46 AM
Hello,

I am trying to upgrade a project to ExtJS 3.2.1 from 2.2. In this project, I have a custom extension of the TwinTrigger component.

This custom component extends Ext.menu.Adapter - which I am aware no longer exists in version 3. The problem is that the Adapter seemed to create a field called 'component', which my custom extension relies on. I have tried changing what my component extends to Ext.menu.Item, Ext.menu.BaseItem, and Ext.Component. None of them have given me that field.

Any suggestions on what I could use to get that field, or would there be a workaround?

Condor
19 Jul 2010, 5:02 AM
Ext.menu.Adapter was removed, because you can now add a component directly to a menu.

What type of component was 'component'?

legrego
19 Jul 2010, 11:46 AM
I believe 'component' references a DatePicker object.
Here is the code:
TimePicker (referenced in the superclass constructor below) extends Ext.Component



Ext.menu.TimeItem = function(config){
Ext.menu.TimeItem.superclass.constructor.call(this, new Ext.TimePicker(config), config);
this.picker = this.component; // <-- this.component is undefined in v. 3.2.1.
this.addEvents({select: true});
this.picker.on("render", function(picker){
picker.getEl().swallowEvent("click");
picker.container.addClass("x-menu-date-item");
});

this.picker.on("select", this.onSelect, this);
};

Ext.extend(Ext.menu.TimeItem, Ext.menu.Adapter, {
onSelect : function(picker, date){
this.fireEvent("select", this, date, picker);
Ext.menu.TimeItem.superclass.handleClick.call(this);
}
});

shilpimogha
14 Sep 2015, 4:26 AM
Hi,

I am getting Ext.menu.BaseItem is undefined error. Using extjs 4 for one module and other is based on extjs 3. How to get it working??


Thanks In Advance