Comments (5)
paste your minimum reproduction code
from gantt.
I change data in collumn and refetch data, but new data not update, so row in <template #default="{ row }"> is old data
`<XGanttColumn prop="timeline" :merge="merge5" width="100">
<template #title="data">
<div>
title timeline
</div>
</template>
<template #default="{ row }">
<div v-show="!row.phaseId">
<!-- timeline={{ fromDate: detailProject?.fromDate, toDate: detailProject?.toDate }} -->
<FieldRangeDate
:placeholder="['DD/MM/YYYY', 'DD/MM/YYYY']"
:value="{ fromDate: row?.startDate, toDate: handleEndDate(row?.endDateAdd) }"
:onSubmit="(value) => handleUpdateFieldValue(row._id, 'timeline', value)"
/>
</div>
</template>
</XGanttColumn>`
from gantt.
I change data in collumn and refetch data, but new data not update, so row in <template #default="{ row }"> is old data `<XGanttColumn prop="timeline" :merge="merge5" width="100"> <template #title="data"> <div> title timeline </div> </template> <template #default="{ row }"> <div v-show="!row.phaseId"> <!-- timeline={{ fromDate: detailProject?.fromDate, toDate: detailProject?.toDate }} --> <FieldRangeDate :placeholder="['DD/MM/YYYY', 'DD/MM/YYYY']" :value="{ fromDate: row?.startDate, toDate: handleEndDate(row?.endDateAdd) }" :onSubmit="(value) => handleUpdateFieldValue(row._id, 'timeline', value)" /> </div> </template> </XGanttColumn>`
reload data
from gantt.
yes reload data, but it not work. I realize this code in useInView, i think problem, but i don't know how to fix
watch( () => [top.value, bottom.value, store.$data.flatData], () => { for (let i = inView.length - 1; i >= 0; i--) { if ( inView[i].hide || inView[i].flatIndex <= top.value || inView[i].flatIndex >= bottom.value || store.$data.flatData[inView[i].flatIndex].id !== inView[i].id ) { inView.splice(i, 1); } } for (let i = top.value; i < bottom.value; i++) { if (!~inView.findIndex((v) => v.flatIndex === i)) { const oldIndex = inView.findIndex((v) => v.flatIndex === store.$data.flatData[i].flatIndex); if (~oldIndex) { inView.splice(oldIndex, 1, store.$data.flatData[i]); } else { inView.push(store.$data.flatData[i]); } } } }, );
if i try this code, reRender all, The screen will flicker,
`watch(
() => [top.value, bottom.value, store.$data.flatData],
() => {
for (let i = inView.length - 1; i >= 0; i--) {
if (
inView[i].hide ||
inView[i].flatIndex <= top.value ||
inView[i].flatIndex >= bottom.value ||
store.$data.flatData[inView[i].flatIndex].id !== inView[i].id
) {
inView.splice(i, 1);
}
}
for (let i = top.value; i < bottom.value; i++) {
const dataIndex = store.$data.flatData[i].flatIndex;
const existingIndex = inView.findIndex((v) => v.flatIndex === dataIndex);
if (existingIndex !== -1) {
inView.splice(existingIndex, 1, store.$data.flatData[i]);
} else {
inView.push(store.$data.flatData[i]);
}
}
},
);`
from gantt.
yes reload data, but it not work. I realize this code in useInView, i think problem, but i don't know how to fix
watch( () => [top.value, bottom.value, store.$data.flatData], () => { for (let i = inView.length - 1; i >= 0; i--) { if ( inView[i].hide || inView[i].flatIndex <= top.value || inView[i].flatIndex >= bottom.value || store.$data.flatData[inView[i].flatIndex].id !== inView[i].id ) { inView.splice(i, 1); } } for (let i = top.value; i < bottom.value; i++) { if (!~inView.findIndex((v) => v.flatIndex === i)) { const oldIndex = inView.findIndex((v) => v.flatIndex === store.$data.flatData[i].flatIndex); if (~oldIndex) { inView.splice(oldIndex, 1, store.$data.flatData[i]); } else { inView.push(store.$data.flatData[i]); } } } }, );
if i try this code, reRender all, The screen will flicker, `watch( () => [top.value, bottom.value, store.$data.flatData], () => { for (let i = inView.length - 1; i >= 0; i--) { if ( inView[i].hide || inView[i].flatIndex <= top.value || inView[i].flatIndex >= bottom.value || store.$data.flatData[inView[i].flatIndex].id !== inView[i].id ) { inView.splice(i, 1); } } for (let i = top.value; i < bottom.value; i++) { const dataIndex = store.$data.flatData[i].flatIndex; const existingIndex = inView.findIndex((v) => v.flatIndex === dataIndex); if (existingIndex !== -1) { inView.splice(existingIndex, 1, store.$data.flatData[i]); } else { inView.push(store.$data.flatData[i]); } } }, );`
This code no problem in my env and who uses it. If you have some minimum reproduction code, I can test it.
from gantt.
Related Issues (20)
- [FEATURE] 希望能有属性支持控制甘特图的显示隐藏以及甘特图左侧的显示隐藏 HOT 1
- [BUG] HOT 1
- [FEATURE]是否可以单条数据上有多个任务? HOT 1
- [FEATURE]能否自定义甘特图的显示范围 HOT 1
- 请问支持一行多个滑块吗? HOT 1
- [BUG] HOT 9
- 你好,请问能不能提供一个给行和列自定义class的方法[FEATURE] HOT 4
- 更新x-gantt的data数据后,如果新数据的时间范围比上一条的数据的时间范围小,则时间轴仍然显示为上一次的时间范围[BUG] HOT 1
- [BUG]DEMO里面的组合式写法,表格全部是空,且目前我运用在项目里 也出现了表格渲染不出来的问题 HOT 8
- 添加ellipsis属性之后 文字超出只显示了省略号, 期待能支持鼠标滑过显示全量文字信息 HOT 1
- 如果数据列表日期为空,那么渲染为报错,为空我传的null[BUG] HOT 6
- 进度条跟最终日期差一天[BUG] HOT 4
- [不知道该发哪里] 大佬 能不能加个微信 HOT 1
- [FEATURE] table 自动调整列宽 HOT 2
- [FEATURE] 滑块文字放在滑块右边而不是内部 HOT 1
- [BUG] unit 切换时 console 报错 HOT 2
- [BUG] elements disappear after scrolling and filtering HOT 4
- [BUG] 在线文档地址挂了 HOT 4
- [BUG] 拖动子级时父级不会跟随增长 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gantt.