TACTIC Open Source
About Gannt in custom layout - Printable Version

+- TACTIC Open Source (http://forum.southpawtech.com)
+-- Forum: TACTIC Open Source (http://forum.southpawtech.com/forumdisplay.php?fid=3)
+--- Forum: TACTIC Discussion (http://forum.southpawtech.com/forumdisplay.php?fid=4)
+--- Thread: About Gannt in custom layout (/showthread.php?tid=22)



About Gannt in custom layout - EricTsuei - 10-30-2019

Here I find some codes in tactic-setup.pdf
in page 155~156

The following example illustrates a Gantt Widget that shows all tasks for a project, the schedule for all asset tasks, and the
schedule for all shot tasks.

but I can't run these code in the custom layout.
shows error:
TACTIC has encountered an error.

Reported Error: "'NoneType' object has no attribute 'get_base_search_type'"





So, How should I do?

here is the code.
Code:
<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>



RE: About Gannt in custom layout - remkonoteboom - 11-08-2019

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)


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>



RE: About Gannt in custom layout - EricTsuei - 11-12-2019

I have put your code in custom layout and seems still have some errors

Error: 'dict' object has no attribute 'get_element_names'