Jump to content

Changing TabSheet order at runtime


bbm

Recommended Posts

Hi,

 

Is it possible to get an event when the order has changed?

 

Try:

function tabPanel.beforeInit(sender, config) {
    config.plugins = [Ext.create('Ext.ux.TabReorderer', {
        listeners: {
            Drop: function(tabpanel, container, dragCmp, startidx, idx, eOpts) {
                //
            }
        }
    })];
}

Best regards.

Link to comment
Share on other sites

In my application I want to save the tab order of the tabs for each operator.

With the drag & drop I want to give the operator an easy way to change the tab order himself.

In this case it would be nice to have any possibility to recognize the last tab order.

 

Best regards

Link to comment
Share on other sites

Maybe like this?!:

function tabPanel.beforeInit(sender, config)
{
    config.plugins = [Ext.create('Ext.ux.TabReorderer', {
        listeners: {
            Drop: function(tabpanel, container, dragCmp, startidx, idx, eOpts) {
                ajaxRequest(sender, '_tabOrderChange', ['startidx='+startidx, 'idx='+idx]);
            }
        }
    })];
}
procedure TMainForm.UniPageControl1AjaxEvent(Sender: TComponent;
  EventName: string; Params: TUniStrings);
begin
  if EventName = '_tabOrderChange' then
  begin
    ShowMessage(Params.Values['startidx'] + ';' + Params.Values['idx']);
  end;  
end;
Link to comment
Share on other sites

  • 4 years later...
On 12/16/2016 at 3:31 AM, Sherzod said:

Maybe like this?!:


function tabPanel.beforeInit(sender, config)
{
    config.plugins = [Ext.create('Ext.ux.TabReorderer', {
        listeners: {
            Drop: function(tabpanel, container, dragCmp, startidx, idx, eOpts) {
                ajaxRequest(sender, '_tabOrderChange', ['startidx='+startidx, 'idx='+idx]);
            }
        }
    })];
}

procedure TMainForm.UniPageControl1AjaxEvent(Sender: TComponent;
  EventName: string; Params: TUniStrings);
begin
  if EventName = '_tabOrderChange' then
  begin
    ShowMessage(Params.Values['startidx'] + ';' + Params.Values['idx']);
  end;  
end;

In the V1.90.0.1547 not show beforeinit

image.png.889361671ffd2c376fc0fcdbbc381980.png

 

 

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