Jump to content

Recommended Posts

Posted
On 7/25/2025 at 7:03 PM, picyka said:

Is there a component similar to TUniPopupMenu that could be used on mobile? Or any suggestions on how to do it?

Hello,

Could you clarify when and how the menu is expected to appear?

Posted

One possible solution:

1. MainmForm.ClientEvents.ExtEvents [form] ->

function form.painted(sender, eOpts) 
{
    this.bodyElement.on('longpress', function(e) {
        Ext.create('Ext.menu.Menu', {
            items: [{
                    text: 'Open',
                    iconCls: 'x-fa fa-folder-open',
                    handler: function() {
                        ajaxRequest(sender, 'menuClick', {
                            mn: 'open'
                        });
                    }
                },
                {
                    text: 'Save',
                    iconCls: 'x-fa fa-save',
                    handler: function() {
                        ajaxRequest(sender, 'menuClick', {
                            mn: 'save'
                        });
                    }
                },
                {
                    text: 'Delete',
                    iconCls: 'x-fa fa-trash',
                    handler: function() {
                        ajaxRequest(sender, 'menuClick', {
                            mn: 'delete'
                        });
                    }
                }
            ]
        }).showAt(e.getX(), e.getY());
    });

}

2. MainmForm.OnAjaxEvent ->

procedure TMainmForm.UnimFormAjaxEvent(Sender: TComponent; EventName: string;
  Params: TUniStrings);
begin
  if EventName = 'menuClick' then
  begin
    if Params.Values['mn'] = 'open' then
      ShowMessage('Open')
    else if Params.Values['mn'] = 'save' then
      ShowMessage('Save')
    else if Params.Values['mn'] = 'delete' then
      ShowMessage('Delete');
  end;
end;

 

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