01-13-2020, 04:38 PM
So in my case, I am using a table in a custom layout widget. On the surface the resulting xml needs to be someting like:
<element name="payments">
<display class="tactic.ui.panel.ViewPanelWdg">
<search_keys>COMMA SEPARATED SEARCH KYES HERE</search_keys>
<search_type>lpc/payment</search_type>
<view>payments_by_tenant</view>
</display>
</element>
but, if the search_keys option is empty it seems to tick off the table wdg so I had to not provide the option at all unless I had search keys. I am using python for this so in my html I have:
<element name="payments">
<display class="tactic.ui.panel.ViewPanelWdg">
${search_keys_option}
<search_type>lpc/payment</search_type>
<view>payments_by_tenant</view>
</display>
</element>
Then for the python I have:
search_keys = kwargs.get("search_keys")
if search_keys:
search_keys_option = "<search_keys>%s</search_keys>" %search_keys
else:
search_keys_option = ""
The ideas is that this is custom layout I am calling into a dashboard where I have a list of search keys I want to draw in a table, by packaging this up into its own custom layout, it was a clean way to pass in the list of search keys as a kwarg to the custom layout.
<element name="payments">
<display class="tactic.ui.panel.ViewPanelWdg">
<search_keys>COMMA SEPARATED SEARCH KYES HERE</search_keys>
<search_type>lpc/payment</search_type>
<view>payments_by_tenant</view>
</display>
</element>
but, if the search_keys option is empty it seems to tick off the table wdg so I had to not provide the option at all unless I had search keys. I am using python for this so in my html I have:
<element name="payments">
<display class="tactic.ui.panel.ViewPanelWdg">
${search_keys_option}
<search_type>lpc/payment</search_type>
<view>payments_by_tenant</view>
</display>
</element>
Then for the python I have:
search_keys = kwargs.get("search_keys")
if search_keys:
search_keys_option = "<search_keys>%s</search_keys>" %search_keys
else:
search_keys_option = ""
The ideas is that this is custom layout I am calling into a dashboard where I have a list of search keys I want to draw in a table, by packaging this up into its own custom layout, it was a clean way to pass in the list of search keys as a kwarg to the custom layout.