简体   繁体   中英

Flex Incompatible Override, bug?

I'm writing an extension to the Flex DataGridColumn class. I want to override the editable and sortable properties so that I can dispatch an event in the setter. So I looked up the method signature from the Adobe Docs (I'm using Flex 3.5 compiler):

Language Version: ActionScript 3.0

Implementation

public function get editable():Boolean
public function set editable(value:Boolean):void
public var sortable:Boolean

I should be able to override both the setter for editable, and use a setter to override the functionality of sortable.

in my code I have:

public override function set editable(value:Boolean):void {
    super.editable = value;
    //code to dispatch event
}

and

public override function set sortable(value:Boolean):void{
   super.sortable = value;
   //code for event
}

However I get a #1023 error : Incompatible override. I've tried all sorts of combinations on the method signatures, but these are exactly the same as the ones in the docs above.

What gives? Am I missing something obvious?

EDIT: Apparently the documentation is not in line with the actual source code. Both editable and sortable are variables in DataGridColumn.as. Anyway I can override them with a setter/getter without modifying the base class? DataGridColumn.as Source:

public var editable:Boolean = true;
public var sortable:Booelan = true;

You cannot override variable as property(get/set). BTW, editable and sortable became properties in SDK 4.0.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM