Jump to content

Remove ext event


freedowsRoO

Recommended Posts

13 hours ago, Sherzod said:

Hi, 

Can you please explain in more details? 

Sure @Sherzod, i have a component with the following code:  

 

ClientEvents.ExtEvents.Add:=('added=function added(sender, container, pos, eOpts){ sender.resizable= true; sender.draggable= true; }');

 

Is there a way to remove this code or set resizeble and draggable to false in runtime?

Link to comment
Share on other sites

6 hours ago, freedowsRoO said:

Is there a way to remove this code or set resizeble and draggable to false in runtime?

For Draggable:

function added(sender, container, pos, eOpts)
{
    sender.resizable= true; 
    //sender.draggable= true;
}

Then, in Runtime:

UniPanel1.Draggable.Enabled := True/False;

 

  • Like 2
Link to comment
Share on other sites

6 hours ago, freedowsRoO said:

Is there a way to remove this code or set resizeble and draggable to false in runtime?

For Resizable:

function added(sender, container, pos, eOpts)
{
    sender.resizable= true; 
    //sender.draggable= true;
}

Stop:

UniPanel1.JSInterface.JSCall('resizer.destroy', []);

Resume:

UniPanel1.JSInterface.JSCall('initResizable', []);

 

  • Like 1
Link to comment
Share on other sites

  • 5 months later...
On 5/23/2019 at 2:19 PM, Sherzod said:

For Resizable:


function added(sender, container, pos, eOpts)
{
    sender.resizable= true; 
    //sender.draggable= true;
}

Stop:


UniPanel1.JSInterface.JSCall('resizer.destroy', []);

Resume:


UniPanel1.JSInterface.JSCall('initResizable', []);

 

Is it possible to resize too many components, such as a UniMemo?

Link to comment
Share on other sites

10 hours ago, herculanojs said:

Is it possible to resize UniMemo runtime?

Also you can use this approach I think.

1. UniContainerPanel

     --->  UniMemo (align = AlClient)

2. 

procedure TMainForm.UniFormCreate(Sender: TObject);
begin
  with UniMemo1.JSInterface do
    JSAddListener('afterrender', 'function(){this.setStyle("width", "100%");this.setStyle("height", "100%")}');

  with UniContainerPanel1.JSInterface do
    JSAddListener('afterrender', 'function(){this.initResizable({'+
      'dynamic: true,'+
      'pinned: true,'+
      'handles: "s e se",'+
      'heightIncrement: 20,'+
      'widthIncrement: 20'+
    '})}');
end;

 

Link to comment
Share on other sites

5 hours ago, Sherzod said:

Also you can use this approach I think.

1. UniContainerPanel

     --->  UniMemo (align = AlClient)

2. 


procedure TMainForm.UniFormCreate(Sender: TObject);
begin
  with UniMemo1.JSInterface do
    JSAddListener('afterrender', 'function(){this.setStyle("width", "100%");this.setStyle("height", "100%")}');

  with UniContainerPanel1.JSInterface do
    JSAddListener('afterrender', 'function(){this.initResizable({'+
      'dynamic: true,'+
      'pinned: true,'+
      'handles: "s e se",'+
      'heightIncrement: 20,'+
      'widthIncrement: 20'+
    '})}');
end;

 

It couldn't be this way, because I need to resize UniEdit, UniMemo, UniNumberEdit, etc ...

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.

Guest
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...