ANovokmet / svelte-gantt

:calendar: Interactive JavaScript Gantt chart/resource booking component

Home Page:https://anovokmet.github.io/svelte-gantt/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How could I set the rowHeight for the target single row?

xeoshow opened this issue · comments

Hello,

In our scenario, we will need to set the different rowHeight regarding different rows, is there any way for doing this?

Just checked the api document, seems only get below, hopefully there could be some api for it.

rowHeight {Number} Height of a single row in px.

Thanks very much.

I found there seems got two places related as below, and both places got row.model context.
Could we add row.model.height for the single row to support this feature? If it is defined, will use row.model.height, otherwise use rowHeight from options.

Thanks v much.

image

image

Yes, sounds like a good feature.

Hi @ANovokmet,
I have implemented this, and tested various cases, seems works good.
I just modified as below:

File Path: 'src/modules/table/TableRow.svelte', line:24

style="height:{$rowHeight}px"

style="height: {row.model.height || $rowHeight}px"

If it is OK, could you please merge it? Thanks.

This needs more consideration: the current virtual scrolling implementation assumes all rows are of the same height. If rows are of different heights, it will result in rendering bugs (missing rows). See rowContainerHeight in Gantt.svelte.

Hi @ANovokmet,

Thanks for reply, so is it still possible to be implemented? Besides the virtual scrolling, is there other aspects should be with more consideration?

Best regards, Jason

@xeoshow This is implemented in v4.4.0, which will be available soon.

Hi @ANovokmet , Thanks, and when will v4.4.0 be available on npmjs.com ?

Best regards, Jason