Layout with multiple custom elements

Layout with multiple custom elements

poisonspoisons Posts: 29Questions: 5Answers: 0

I'm trying to set some custom inputs between the topstart and topend, using the layout method

I setup a custom div with a const toolbar, then I tried to render with layout

layout: {
          topStart: {
            pageLength: {
              menu: [ 10, 25, 50, 100 ]
            }
          },
          top: {
            toolbar
          },
          topEnd: {
            search: {
              placeholder: 'Type search here'
            }
          }
        }

It returns an error "Cannot read properties of undefined (reading 'apply')"

I also tried this, using the multiple elements array

layout: {
          topStart:
            [
              pageLength,
              toolbar
            ],
          topEnd: {
            search: {
              placeholder: 'Type search here'
            }
          }
        }

but again it returns an error "pageLength is not defined"
What is the right way to use layout having some custom elements rendered between topstart and topend?

Answers

  • allanallan Posts: 64,940Questions: 1Answers: 10,755 Site admin

    You've used pageLength as a variable there (same with toolbar). It should be a string:

    topStart: [ 'pageLength', ... ]
    

    I don't know if toolbar is meant to be a variable, or a plugin?

    If you want something in between topStart and topEnd use top as an array. See this discussion from yesterday which was asking basically the same thing.

    Allan

  • poisonspoisons Posts: 29Questions: 5Answers: 0

    Thanks @allan I missed the yesterday conversation

  • allanallan Posts: 64,940Questions: 1Answers: 10,755 Site admin

    This forum has 75'000 discussions - missing one is easy to do :).

    Allan

Sign In or Register to comment.