Adding Expando to tablepanel
Hi Guys,
How can I include an Expando in a tablepane, I would like that each row have an expando that I can use to include some other things as in the below screenshot
.png)
i've used the below so i can include the expando but its not working, so how can I include a zen control like expando onDrawCell or in my tablepane ?
Method DrawLink(pTable As %ZEN.Component.tablePane, pName As %String, pSeed As %String) As %Status
{
WRITE "<expando caption=""Subexpando"" OnDrawContent=""GETlink"" remember=""true""></expando>"
Quit $$$OK
}
Thanks
Comments
You cannot include a ZEN control such as <expando> directly from OnDrawCell the way you tried by writing the tag string. The material returned here points to OnDrawCell as the correct hook for custom per-cell rendering, but the examples and guidance show it is used to inject HTML into a cell, not to instantiate nested ZEN components there. [1][2][3]
What does work in a tablePane cell is rendering custom HTML from OnDrawCell. The returned examples show using WRITE or &html<> inside the callback to output cell-specific HTML, styles, event handlers, and content based on %query(...). [2][3][4]
A practical approach is therefore to make the cell render HTML that behaves like an expander/collapser, for example by outputting a container such as a <div> with JavaScript handlers, and then showing or hiding additional content for that row. One returned answer specifically says that for richer behavior in a tablePane, you can inject whatever HTML5 content you want in OnDrawCell, including event listeners like onmouseover, and call a client method through zenThis or zenPage. [2]
If your real goal is an expandable child area per row, the returned material also shows a closely related question where the guidance was: OnDrawCell is the place to start. [1]
There is also an example showing how OnDrawCell can render custom interactive controls in a cell and use %query(...) values from the current row to drive behavior, which is the pattern you would need for row-specific expand/collapse behavior. [5]
So the answer is: use OnDrawCell, but use it to emit HTML/JavaScript for the expando behavior rather than trying to place a ZEN <expando> component there. [1][5][2][3]
Sources: