gridpanel: combobox in column editor not showing after edit

  1. #1

    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:

                     <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
    Attached Thumbnails Click image for larger version. 

Name:	gridpanel_combo.png 
Views:	397 
Size:	6.0 KB 
ID:	3836  
    Last edited by lapix; Feb 16, 2012 at 7:26 PM.
  2. #2

    solved

    Solved... forgot idProperty in the combo store reader.
    Last edited by lapix; Feb 20, 2012 at 12:17 AM. Reason: fixed bug

Similar Threads

  1. Replies: 14
    Last Post: Aug 18, 2016, 1:57 AM
  2. [CLOSED] gridpanel with combobox column editor
    By Marcelo in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Dec 30, 2011, 6:53 PM
  3. [CLOSED] ColumnTree editor showing in only one column
    By kenanhancer in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Dec 19, 2010, 9:16 PM
  4. Replies: 2
    Last Post: Oct 28, 2010, 8:59 PM
  5. [CLOSED] Edit current record in a Column-Editor.
    By macap in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Nov 04, 2009, 3:57 PM

Tags for this Thread

Posting Permissions