Requested: Layout api

Requested: Layout api

Loren MaxwellLoren Maxwell Posts: 387Questions: 94Answers: 10

@allan , @colin -- I'm very much enjoying DT 2.0 and especially like the new layout option.

I think a great addition to the API would be the ability to be able to select a specific portion of the layout and to show/hide that portion (and maybe some other operations).

    layout: {
        top1Start: {
                name: 'main-buttons',
                buttons: {
                        ... buttons code ...
                }
        },
        top1End: {
                name: 'more-buttons',
                buttons: {
                        ... buttons code ...
                }
        },
        topStart: 'info',
        bottom: 'paging',
        bottomStart: null,
        bottomEnd: null
    }

This could be done either through specifying the layout property, such as top1End, or using a name layout-selector:

table.layout('top1End').hide()
table.layout('more-buttons:name').show()

I know the buttons themselves can be shown or hidden, but controlling the layout itself would allow a more complicated layout to be shown or hidden in total.

Replies

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    Interesting idea - thanks for the suggestion! If there are other requests and scenarios where this would be useful, it is certainly some I can look at adding.

    Allan

Sign In or Register to comment.