question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Slot for custom footer/header

See original GitHub issue

Hey there, I’m slowly dipping into parts of the library and so naturally some ideas are coming up 😃

What I’ve seen is that while a custom footer is supported, it essentially takes a bare-bones string with a few modifications. In my case there might be more that will come into the footer, such as a customized pagination.

So what would you say if the aurelia-slickgrid custom element would expose a named slot for both headers and footers like:

<slot name="slick-header"></slot>
<slot name="slick-footer"></slot>

so that the consumer could pump in whatever he likes in those places

<aurelia-slickgrid grid-id="grid2"
                       column-definitions.bind="columnDefinitions2"
                       grid-options.bind="gridOptions2"
                       dataset.bind="dataset2"
                       grid-height="300"
                       grid-width="800">
      <div slot="slick-header">A BIG HEADER</div>
      <div slot="slick-footer">That's my footer</div>
    </aurelia-slickgrid>

I’d like to discuss this first with you @ghiscoding but can afterwards provide a PR if you’d like

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ghiscodingcommented, Sep 25, 2020

The auto-resize tries to calculate the available size from the div container that you include aurelia-slickgrid inside, <div id="grid-container"> that is what the containerId is for.

However, the auto-resize doesn’t always work, it could depend on multiple factors that could screw up the calculation, for example in Salesforce, some of the grids are inside a white box and the auto-resize doesn’t seem to take it in consideration and I need to manually add padding. In the example below, if I don’t add the extra padding the grid goes outside the white box and I think it also doesn’t calculate the footer (where you see “Submit an Idea” and “Log an Issue”) either and because of that I need to a bottom padding of 80 and that fixes the example below (actually the Footer showing 1 of 1 items is a bit too close to the edge, I should probably increase the padding to 85 or something).

Things to note, whatever padding you add to the autoResize becomes part of the auto resize calculation, so if for example it calculates that it has 600px available and you provide a bottomPadding: 80, it will calculate 600 - 80 and resize the grid to a height of 520px. If you enable the Footer/Pagination, it will internally add bottomPadding to the calculation. Also how this is done is via a browser resize event to recalculate, basically this $(window).on("resize.grid." + this._gridUid), so every time you resize the browser it will resize the grid and so it’s not CSS, it’s really done with JS.

image

0reactions
zewa666commented, Sep 25, 2020

so bottomPadding in that case would relate to the size of the slotted footer? What is containerId pointing to?

Well yeah, px rule the world 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

LWR Theme Header and Footer with slots
I have recently made a new LWR site and want the header and the footer to be fully custom. I am ...
Read more >
Header, footer and main layout with v-slot in Vue.js | Example
Learn how to create a header, footer and main content layout using the v-slot as a layout in different components in Vue.js.
Read more >
How to Add a Custom Header and Footer to a Document in ...
To switch between the header and footer when editing, click the Go to Footer button. To switch back, click Go to Header. These...
Read more >
[Feature Request] Allow slot for table footer (summary) #5794
I am trying to use table to view and edit database tables. It would look nice if I can use the table footer...
Read more >
Table: Before/After slots (header/footer) - Quasar Playground
https://quasar.dev/vue-components/table#Example--Before%2FAfter-slots-(header%2Ffooter). 4. -->. 5. <div id="q-app">. 6. <div class="q-pa-md">. 7. <q-table.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found