Jump to content

[mobile] How to remove a jsconfig property from parent control?


Recommended Posts



Let us say that I want to create my OWN button which inherent from 'TUnimButton', and I want to add several config properties to it: iconCls,style and flex I would do:

  TmMYButton = class(TUnimButton)
    Fstyle: string;
    FiconCls: Ticons;
    Fflex: integer;
    procedure Setstyle(const Value: string);
    procedure SeticonCls(const Value: Ticons);
    procedure Setflex(const Value: integer);
    procedure ConfigJSClasses(ALoading: Boolean); override;
    procedure LoadCompleted; override;
    constructor Create(AOwner:TComponent); override;
  property style:string read Fstyle write Setstyle;
  property iconCls:Ticons read FiconCls write SeticonCls;
  property flex:integer read Fflex write Setflex;

And in loadcomplete I use this code, to add my properties to the mybutton config:

type THackControl=class(TUniControl);
procedure TmMYButton.LoadCompleted;
if FiconCls<>iNon then
 icn:= GetEnumName(TypeInfo(Ticons),integer(FiconCls))
 if flex>0 then JSConfig('flex',inttostr(flex));

My proplem is: The base class for my button is 'TUnimButton' and it has other config properties like: width,height.... I want to remove for example the 'width' property from base class 'TUnimButton' so when the config sent to brwoser it will NOT contain the 'width' property, how can I do that?


This is a unitouch code sent to browser:

O2F=new Ext.Button({id:"O2F_id",text:"UnimButton1",width:225,height:47,left:48,top:144});

It is not only about specific property it is all about making the development more easy for us and less depended on unitouch component future updates, So we feel that we are sometimes tied with these properties that we don't want or we want to change and we don't have the ability to change them (not for my own need, but for the logical behavior of such component in real production app), so our solution is to create inherent component and add any property or any thing we want. BUT how can I 'remove' property from config which declared in parent class?


Any suggestion would be great!


Thank you,

  • Upvote 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...