甘特图前身使用JSGrid控件
我正在尝试使用共享点控件创建甘特图生成器:
<Sharepoint:JsGrid>
我遵循了本教程:如何:使用 JS 网格控件创建甘特图
我还将我的 Sharepoint TaskList 链接为数据源。
我使用一些 XML 开发了一个过滤器系统。
但我现在想管理前辈并用箭头表示依赖关系。
为了管理它们,我使用了 EnableGantt 函数的最后一个参数 (ganttDependentsColumnName
),该参数只需要包含依赖项信息的列的名称。
我必须在此栏中放入什么?
我尝试的是用任务的ID、包含前辈的DataRow的通道来填充它,并且我尝试放置一个Dependency类的对象:(
class Dependency : IJsonSerializable
{
public object Key {get; set;} // RecordKey
public LinkType{get; set;} //LinkType
public string ToJson(Serializer s)
{
return JsonUtility.SerializeToJsonFromProperties(s,this);
}
}
此代码来自教程中的答案)
在Key中,什么我必须放吗?如果有人做到了或者知道如何做到这一点,那就太好了。
I am trying to create a Gantt Chart generator, using the Share point control:
<Sharepoint:JsGrid>
I followed this tutorial: How to: Create a Gantt Chart Using the JS Grid Control
I also linked my Sharepoint TaskList as the data Source.
I developped a system of filters using some XML.
But I now want to manage predecessors and represent dependencies by an arrow.
To manage them, I used the last parameter of the EnableGantt function (ganttDependentsColumnName
), which one just need the name of the column which contains the dependency information.
What I have to put in this column ?
What I tried is to fill it with the ID of the task, the lane of the DataRow containing predecessors, and I tried to put an object of the class Dependency :
class Dependency : IJsonSerializable
{
public object Key {get; set;} // RecordKey
public LinkType{get; set;} //LinkType
public string ToJson(Serializer s)
{
return JsonUtility.SerializeToJsonFromProperties(s,this);
}
}
(This code is from the answers in the tutorial)
In the Key, what do I have to put? If someone did it or know how to do it, It could be nice.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不确定您是否仍然面临这个问题。但这就是我们为
Predecessors
列所做的,据我所知:1] 稍微更改 Dependency 类以添加所示的构造函数(否则会出错)。
2]然后,您基本上需要将
Dependency
数组传递给Predecessors
列,这意味着 JSGrid 控件需要知道起点/行和终点/行依赖关系(因此需要一个数组)。由于继承和 ToJson 方法,JSON 序列化已经得到处理,因此不用担心。代码:
1] 依赖类:
2] 如果不针对 SharePoint 任务列表,则添加列(其中数据是 DataTable 的对象):
3] 将正确的对象数组设置为
Predecessors
列:最后,传递调用
EnableGantt()
函数时的Predecessors
列:确保您的 StartFinish 和 FinishStart 链接类型匹配正确的行,并且您的任务已正确列出,并具有正确的任务开始日期、任务结束日期和前置键。
Not sure if you are still facing this issue. But this is what we did for the
Predecessors
column and this is as far as I understand this:1] Change the Dependency class a bit to add a constructor as shown (otherwise it errors out).
2] Then, you basically need to pass a
Dependency
array to thePredecessors
column which means that the JSGrid control needs to know the starting point/row and the ending point/row of the dependency (thus an array is required). JSON Serialization is taken care of already because of the inheritance and theToJson
methods so no worries there.Code:
1] Dependency Class:
2] Add column if not targeting a SharePoint Task List (where data is an object of DataTable):
3] Set the right object array to the
Predecessors
column:Finally, pass the
Predecessors
column while calling theEnableGantt()
function:Make sure that your StartFinish and FinishStart link types matches the correct rows and that your tasks are listed correctly with correct task start dates and task end dates and predecessor keys.