The TACTIC Custom Layout Editor is a key tool for building enterprise applications in TACTIC. When building dynamic enterprise applications, dynamically loaded view or a custom widget make for a much better end user experience.
spt.panel.load(element, class_name, kwargs);
<input type=”button tactic_load” view=”customers.list” target=”content” value=”View Customers” />
This will create a button with the label “View Customers”. When clicking, it will dynamically load the view “customers.list” into the “content” element. This is a very simple way to create a dynamically loaded applications. It is very useful for creating sidebars or menu items.
Sometimes arguments need to passed to this new view. This is easily done by adding extra attributes to the html element
<input type=”button tactic_load” view=”customers.list” target=”content” search_type=”workflow/asset” value=”View Customers” />
This will add the “search_type” key with the value “workflow/asset” into the kwargs of the view “customer.list”. This is very useful for configuring the usage of a widget that is to be loaded. Even more powerful would be to make the value a variable that is determined in Python.
Similarly, the “tactic_popup” class will open up a popup with the corresponding widget. This is often used to open up edit or insert widgets or to display some additional information.
The use of these built-in classes make for a very powerful application building tool. For a concrete example, this is how the TACTIC Portal loads most of its content. Since these classes can open up any widget in TACTIC, one can create complex dynamic applications very quickly.