Jump to content

Accessing ExtJS layoutconfig 'multi' for accordian layout


HISPhilip

Recommended Posts

Hi I want to use the multi layoutconfig function of the Accordian layout and tried using ExtEvents to implement it:

 

http://docs.sencha.com/extjs/6.2.0/classic/Ext.layout.container.Accordion.html

 

(Just add 'multi:true' within layout:{} and you can see behaviour in the jsfiddle example).

 

This is my first time using ExtEvents and after trial and error the following will enable multiple panels to show:

function afterlayout(sender, layout, eOpts)
{
  layout.setLayout ({
      multi : true
  });
}

But all panels except top can expand but then collapse/expand button do not work anymore. I.E. the collapse/expand button only works once (first panel is already expanded by default so after a collapse can't be expanded). I may be using the wrong event and if there's an easier way to implement that would be even better.

Link to comment
Share on other sites

Hi,

 

Try this:

function beforeInit(sender, config)
{
    config.layout = {
        type: 'accordion',
        titleCollapse: false,
        animate: true,
        activeOnTop: true,
        multi: true
    }
}

Best regards,

Link to comment
Share on other sites

Hi, I've tried but couldn't get it to work (can't find event beforeInit either). I also tried adding programatically via ClientEvents.ExtEvents.Add('');

 

I should note I'm trying to get it work on a UniPanel i.e. Ext.panel.panel. I've tried some other events as well not much success

Link to comment
Share on other sites

Hi, I can't find event 'beforeInit' and I'm using one of the later beta versions because the latest release wasn't working very well with my project. uniGUI version: 1.10.0.1451 although I don't think this matters too much. I've been able to put the 'multi' setting on accordians on the ExtJS jsfiddles fine just having a hard time getting it to work from within delphi

Link to comment
Share on other sites

Sorry my bad I thought it had uploaded with my post, didnt realise there was an extra button to attach it. So the outer most panel has the accordian layout and I believe this is the one I should be assigning ExtEvents to (haven't put anything in it in the file)

Project1.zip

Link to comment
Share on other sites

OK,

 

1. Remove:

 

function afterlayout

function afterlayout(sender, layout, eOpts)
{
  //layout.config ({
  //    multi : true
  //});
}

2. Add:

 

UniPanel1 -> ClientEvents -> UniEvents -> function beforeInit:

function beforeInit(sender, config)
{
    config.layout = {
        type: 'accordion',
        titleCollapse: false,
        animate: true,
        activeOnTop: true,
        multi: true
    }
}
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...