Feb 16, 2012, 7:02 PM
gridpanel: combobox in column editor not showing after edit
Hello, I have an issue with a combobox inside a column;
I have a gridpanel with a button to add rows client side; when I add a row there's a combobox with some values, correctly shown.
I select a value from the combo, but when I m done the combo is not shown, nor value or text of it, but the column has value since I can see the small modified red indicator (see image attached).
I have another column with textfield working properly in the secondo column.
I use a renderer script to show the combo text, but apparently the problem is not that one.
when I go back to a previously edited row, when I double click the cell the combo appears and show the correct previously selected value, so it looks like a display issue...
here's the code for gridpanel and combobox:
this is the code for the renderer:
Many thanks in advance
I have a gridpanel with a button to add rows client side; when I add a row there's a combobox with some values, correctly shown.
I select a value from the combo, but when I m done the combo is not shown, nor value or text of it, but the column has value since I can see the small modified red indicator (see image attached).
I have another column with textfield working properly in the secondo column.
I use a renderer script to show the combo text, but apparently the problem is not that one.
when I go back to a previously edited row, when I double click the cell the combo appears and show the correct previously selected value, so it looks like a display issue...
here's the code for gridpanel and combobox:
<ext:GridPanel
runat="server"
ID="grdVarieta"
Title="varietà"
StripeRows="true"
AutoExpandColumn="clVarieta">
<Store>
<ext:Store runat="server" ID="storeVarieta" >
<Reader>
<ext:JsonReader IDProperty="IdPif08">
<Fields>
<ext:RecordField Name="varieta" ServerMapping="IdXst01Pif08.Value" />
<ext:RecordField Name="nrPiante" ServerMapping="Qta.Value"/>
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
</Store>
<ColumnModel runat="server" >
<Columns>
<ext:Column Header="Varietà" ColumnID="clVarieta" DataIndex="varieta" >
<Renderer Fn="Renderer" />
<Editor>
<ext:ComboBox
runat="server"
ID="cbVar"
ForceSelection="true"
TriggerAction="All"
DisplayField="DescrizioneXst01"
ValueField="IdXst01">
<Store>
<ext:Store runat="server" ID="storeCbVar" >
<Reader>
<ext:JsonReader>
<Fields>
<ext:RecordField Name="IdXst01" ServerMapping="IdXst01.Value" />
<ext:RecordField Name="DescrizioneXst01" ServerMapping="DescrizioneXst01.Value" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
</Store>
</ext:ComboBox>
</Editor>
</ext:Column>
<ext:NumberColumn Header="Numero piante" DataIndex="nrPiante" Format="000">
<Editor>
<ext:TextField runat="server" ID="txtNrPiante" />
</Editor>
</ext:NumberColumn>
</Columns>
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel ID="RowSelectionModel1" runat="server" />
</SelectionModel>
<Buttons>
<ext:Button runat="server" ID="btnAddVarieta" Icon="Add" Text="Aggiungi varietà">
<Listeners>
<Click Handler="var rowIndex = #{grdVarieta}.addRecord(); #{grdVarieta}.getView().focusRow(rowIndex); #{grdVarieta}.startEditing(rowIndex, 0);" />
</Listeners>
</ext:Button>
</Buttons>
</ext:GridPanel>
this is the code for the renderer:
<ext:ResourcePlaceHolder ID="ResourcePlaceHolder2" runat="server" />
<script type="text/javascript">
var Renderer = function (value) {
var r = storeCbVar.getById(value);
if (Ext.isEmpty(r)) {
return "";
}
return r.data.DescrizioneXst01;
};
</script>
Can someone tell me why the combo is not shown after edit? Many thanks in advance
Last edited by lapix; Feb 16, 2012 at 7:26 PM.