Jump to content

O.T.: @javascript-profis: Drag&Drop of unipanel...


erich.wanker

Recommended Posts

Hello 

 

i want to create at runtime different uniPanels...

 

Att runtime - i add in ClientEvents / ExtEvents :

 

function afterrender(sender, eOpts)
{
  sender.dd = new Ext.dd.DDProxy(sender, '');
  sender.dd.afterDrag = (function (){sender.doLayout()});


  Ext.onReady(function ()
    {       
      Ext.get(sender.id).select(".x-form-field").each(function (el) {sender.dd.addInvalidHandleId(el.dom.id)})
    }
  );
  
}

.. so i can drag and drop the panel in a UniForm ..

 

1.) Now i want to save the position of the unipanels for the next time (a array of uniPanels) - but when i read the position per delphiCode - the actual position of a moved-uniPanel is not read .. (it´s clear that a javascript should update the position to a delphi-variable .. but i dont know how)

 

2.) how can i prevent that a unipanel moved out of the UniForm.showmodal-Window? ( if left < 0 then left:=0)

 

ThanX for suggestions

 

 

 

Link to comment
Share on other sites

Hi Erich,

 

Now, you can use:

 

UniPanel1.Draggable.Enabled = [True]

 

i.e.:

 

1.

function afterrender(sender, eOpts)
{
  //sender.dd = new Ext.dd.DDProxy(sender, '');
  //sender.dd.afterDrag = (function (){sender.doLayout()});

  Ext.onReady(function ()
    {       
      Ext.get(sender.id).select(".x-form-field").each(function (el) {sender.dd.addInvalidHandleId(el.dom.id)})
    }
  );  
}

2. UniPanel1.Draggable.Enabled = [True]

 

Best regards.

Link to comment
Share on other sites

  • 1 month later...

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