Page 1 of 1

[INFO REQ] Why aren't the layout classes exported?

Posted: Fri Oct 15, 2021 4:39 pm
by henrique

I wonder why layout classes are not exported to the typescript definition file?


Re: [INFO REQ] Why aren't the layout classes exported?

Posted: Sat Oct 16, 2021 10:19 am
by Animal

They are never needed to be instantiated. They are only used by Containers (Such as the base Container class, Panel, and of course TabPanel which uses Card layout).

You specify the layout type in the Container's config using the name as a string:

myPanel = new Panel({
    title  : 'This Panel shows muiltiple children one at a time',
    layout : 'card',
    items  : [child1, child2, child3]
});

Re: [INFO REQ] Why aren't the layout classes exported?

Posted: Mon Oct 18, 2021 8:09 pm
by henrique

I agree, but neither the settings have in the typescript definition file.

I found the possible settings, looking at the sources, I managed to do what I needed, but it would be very interesting, at least the settings be exported.


Re: [INFO REQ] Why aren't the layout classes exported?

Posted: Tue Oct 19, 2021 11:05 am
by sergey.maltsev

Hi!

Unfortunately currently we have no such values in typings file.
This is Feature Request to add those:
https://github.com/bryntum/support/issues/3583


Re: [INFO REQ] Why aren't the layout classes exported?

Posted: Mon Apr 25, 2022 10:25 am
by johan.isaksson

Hi,

An update on the topic. In version 5.1.0 we will specify available options where possible for string types. For example eventLayout in Scheduler, which is currently defined like this in the typings:

eventLayout: string

Will starting with 5.1.0 instead be declared as:

eventLayout: 'stack'|'pack'|'none'

We aim to improve on this moving forward, by adding enums or similar for more complex cases (such as time units, we allow many different ways of specifying them)