PDA

View Full Version : [CLOSED] I think I put that in the preface Dynamic RowExpander



rthiney
Sep 24, 2012, 7:41 PM
Is it possible to change what template you want to apply in a row expander based on a value from the record?

For example:

<ext:RowExpander ID="RowExpander" runat="server" ExpandOnEnter="true" SingleExpand="true">

if (record.data.ChangeType=='Added')
<Template runat="server" ID="t1">
<Html>
<h1>Added</h1>
{Field1}
</html>
</Template?
else
<Template runat="server" ID="t1">
<Html>
<h1>Changed</h1>
{Field1}
</html>
</Template?
</ext:RowExpander>

Daniil
Sep 25, 2012, 7:20 AM
Hi,

Please use a conditional statement.

<tpl if="some condition">

Here you can find more details.
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.XTemplate

rthiney
Sep 25, 2012, 3:40 PM
Is it possible to change what template you want to apply in a row expander based on a value from the record?

For example:

<ext:RowExpander ID="RowExpander" runat="server" ExpandOnEnter="true" SingleExpand="true">

if (record.data.ChangeType=='Added')
<Template runat="server" ID="t1">
<Html>
<h1>Added</h1>
{Field1}
</html>
</Template?
else
<Template runat="server" ID="t1">
<Html>
<h1>Changed</h1>
{Field1}
</html>
</Template?
</ext:RowExpander>




Will this work if I'm using a rowexpander in a grid?

Daniil
Sep 25, 2012, 6:02 PM
Will this work if I'm using a rowexpander in a grid?

I am not sure what you mean: your code sample or my suggestion?

If the first, then no, it won't work. If the second, yes, it will work.