Code Monkey home page Code Monkey logo

Comments (13)

daybrush avatar daybrush commented on June 20, 2024 1

@liuJchun

Probably because batching doesn't happen while loading
The following phenomena may occur.

Try to set data-grid-lazy="true" on item element?

from egjs-grid.

daybrush avatar daybrush commented on June 20, 2024 1

@stepanjakl

Modify the column value directly through resize event or resizeObserver.

grid.column = 2 ~ 4

from egjs-grid.

stepanjakl avatar stepanjakl commented on June 20, 2024

Hi, I'm encountering an issue with columns in which one of the columns with a percentage width doesn't have enough space to fill out its spot when the gap option is set.

Here's a pen.

from egjs-grid.

daybrush avatar daybrush commented on June 20, 2024

@stepanjakl

align: 'justify', independent of gap.

If so, change it to align: "center", "start", "end".

from egjs-grid.

stepanjakl avatar stepanjakl commented on June 20, 2024

Hi @daybrush, even if I align the columns differently, the layout is not correct. There should be 3 columns instead of 2 as each column has width of 33.333%. Please see the example in the previous message. Preferably, the script should take column width into consideration when calculating the gap?

from egjs-grid.

daybrush avatar daybrush commented on June 20, 2024

@stepanjakl

33.333%, so the sum of the three is 100%.
Therefore, it is difficult to set the gap to 30 (set 0).

from egjs-grid.

stepanjakl avatar stepanjakl commented on June 20, 2024

Yes, but if I set gap to 0 then there'll be no gap between the columns. I was hoping the script would calculate the gap taking column width into consideration. Does it make sense?

from egjs-grid.

stepanjakl avatar stepanjakl commented on June 20, 2024

I did sort it out this way btw:

<div class="w-full md:w-[calc(50%-(1rem/2))] lg:w-[calc(33.333333%-(1rem/(3/2)))]{% if loop.index === 1 %} lg:pt-40{% elseif loop.index === 3 %} lg:pt-20{% endif %}">

But this is not an ideal solution. The grid library should ideally compute the gap without me adjusting the column width.

from egjs-grid.

daybrush avatar daybrush commented on June 20, 2024

@stepanjakl

It can't be helped because you set the width yourself.

If you expect to automatically change the width, try setting it with the following option. Instead, you must input the column value directly.

columns: 3,
gap: 30;
align: "stretch",

from egjs-grid.

stepanjakl avatar stepanjakl commented on June 20, 2024

Okay, I tried it, but it's overflowing its parent container now. Moreover, is there a way to set column breakpoints for different viewport widths?

Screenshot 2023-05-09 at 11 53 04

from egjs-grid.

daybrush avatar daybrush commented on June 20, 2024

@stepanjakl

image

Try modifying align to "stretch".

from egjs-grid.

stepanjakl avatar stepanjakl commented on June 20, 2024

Ouh nice, that works, thanks! :)

One more question, how to handle responsivity when it comes number of columns or gap width?

from egjs-grid.

stepanjakl avatar stepanjakl commented on June 20, 2024

Awesome, thank you. It's great library in any case.

from egjs-grid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.