vkurko / calendar

Full-sized drag & drop JavaScript event calendar with resource & timeline views
https://vkurko.github.io/calendar/
MIT License
964 stars 82 forks source link

Cant scroll horizontal on resource view #268

Closed kstan79 closed 1 month ago

kstan79 commented 1 month ago

as below example i define multiple resources, it shrink down the column so tiny and cause the event cant render well. sample1

I'm tried to change css to set min-width.

.ec-resource{
    @apply !min-w-32
}

so far column width expand but cause issue like it cant render calendar well. I tried multiple way and no luck, result either:

  1. some resource draw outside calendar boundary (teacher8 & unknown outside calendar)
  2. or i freeze body width 100vw and no overflow-x scrollable will cause below sample2 sample3

is there anyway can render calendar nicely when render near 40 resources?

kstan79 commented 1 month ago

i manage to solve by manually set 'ec' width at runtime:

const colwidth = 8 //rem
const calResources = getResources()
const totalwidth = calResources.length * colwidth + 3 //+3rem require for times column
      if(document.getElementById('ec')!== undefined){
        document.getElementById('ec').style.width = totalwidth+'rem'
      }

however, I not think it is a good and permanent solution (maybe different browser will have different issue), so far any more "official" way?

vkurko commented 1 month ago

Please take a look at this comment. The official solution to this issue will be Resource Timeline view, which is currently in development.