PDA

View Full Version : [OPEN] XTemplate+ComboBox Can't be used in Column Editor



sipo
Mar 30, 2009, 6:51 AM
I can't apply XTemplate in Editor ComboBox .

But the same code does work when not in Column Editor.



<ext:GridPanel runat="server" ID="GridPanel_RuKuMingXi" Title="GridPanel_RuKuMingXi"
StoreID="Store1" Icon="Lorry" Header="false" Border="false">
<ColumnModel ID="ColumnModel1" runat="server">
<Columns>
<ext:Column ColumnID="company" DataIndex="company" Header="company">
<Renderer Fn="companyRender" />
<Editor>
<ext:ComboBox
ID="ComboBox2"
runat="server"
StoreID="Store2"
DisplayField="company"
ValueField="company"
TypeAhead="false"
LoadingText="Searching..."
Width="570"
ListWidth="900"
HideTrigger="true"
TriggerAction="All"
Mode="Remote"
Select&#111;nfocus="true"
ItemSelector="div.search-item"
>
<Template runat="server">
<tpl for=".">
<div class="search-item">
1111111111111


</tpl>
</Template>
</ext:ComboBox>
</Editor>
</ext:Column>
</Columns>
</ColumnModel>
</ext:GridPanel>

Vladimir
Mar 30, 2009, 8:14 AM
Hi,

Yes, there is a problem with it.

I can suggest nexrt work-around

1. Define manually XTemplate before grid (XTemplate can be invisible for intellisense, it's ok, don't confuse)


<ext:XTemplate ID="Tpl1" runat="server">
<tpl for=".">
<div class="search-item">
{text}


</tpl>
</ext:XTemplate>

2. Then define this template in combo


<ext:ComboBox ID="cbStates"
runat="server"
ItemSelector="div.search-item"
>
<CustomConfig>
<ext:ConfigItem Name="tpl" Value="#{Tpl1}" Mode="Raw" />
</CustomConfig>
</ext:ComboBox>

sipo
Mar 30, 2009, 2:51 PM
besides, coolite can't set xtemplate in code-behind, it's read-only.

Vladimir
Mar 30, 2009, 2:53 PM
Hi,

Read-only instance of Template but you can change properties



ComboBox1.Template.Text = "<tpl ....";