11-08-2019, 03:33 PM
(This post was last modified: 11-08-2019, 03:35 PM by remkonoteboom.)
This is a pretty complex gantt example as it searchs for child tasks and draws the min/max values on the gantt.
If you are directly pasting this into the custom view, then it will not work because this is a definition for a column of a table. The class GanttElementWdg is derived from BaseTableElementWdg which are columns. This should be defined in either a view in the widget config table or you can directly set it directly by wrapping a TableLayoutWdg around it. Here is an example that should work. Note that you can put an search type (in this case it, it is vfx/shot)
If you are directly pasting this into the custom view, then it will not work because this is a definition for a column of a table. The class GanttElementWdg is derived from BaseTableElementWdg which are columns. This should be defined in either a view in the widget config table or you can directly set it directly by wrapping a TableLayoutWdg around it. Here is an example that should work. Note that you can put an search type (in this case it, it is vfx/shot)
Code:
<element>
<display class="tactic.ui.panel.TableLayoutWdg">
<search_type>vfx/shot</search_type>
<view>table</view>
<config>
<element name="code"/>
<element name="name"/>
<element name="task_schedule">
<display class="tactic.ui.table.GanttElementWdg">
<options>
[
{ "start_date_expr": "@MIN(sthpw/task.bid_start_date)",
"end_date_expr": "@MAX(sthpw/task.bid_end_date)",
"color": "white",
"edit": "true",
"default": "true"
},
{ "start_date_expr": "@MIN(sthpw/task['search_type', '~', 'asset'].bid_start_date)",
"end_date_expr": "@MAX(sthpw/task['search_type', '~', 'asset'].bid_end_date)",
"color": "red",
"edit": "true",
"default": "false"
},
{ "start_date_expr": "@MIN(sthpw/task['search_type', '~', 'shot'].bid_start_date)",
"end_date_expr": "@MAX(sthpw/task['search_type', '~', 'shot'].bid_end_date)",
"color": "blue",
"edit": "true",
"default": "false" }
]</options>
</display>
<action class="tactic.ui.table.GanttCbk">
<sobjects>@SOBJECT(prod/shot.sthpw/task)</sobjects>
<options>[
{ "prefix": "bid",
"sobjects": "@SOBJECT(sthpw/task)",
"mode": "cascade"
},
{ "prefix": "bid",
"sobjects": "@SOBJECT(sthpw/task['search_type', '~', 'asset'])",
"mode": "cascade"
},
{ "prefix": "bid",
"sobjects": "@SOBJECT(sthpw/task['search_type', '~', 'shot'])",
"mode": "cascade" }
]</options>
</action>
</element>
</config>
</display>
</element>