[CLOSED] "Blank" gridpanel column until edited...then blank again!

  1. #1

    [CLOSED] "Blank" gridpanel column until edited...then blank again!

    Greetings,

    I am trying to create a simple column in a grid that contains the key of a column, but displays the value.

    Unfortunately right now I am getting a blank column (it does not display the values), except when it's clicked on to edit. After editing, the column becomes blank again. The value is saved, however.

    I am going off the example at the EXT.NET website:

    https://examples1.ext.net/#/GridPane...Field_Mapping/

    I've done everything I can to make this work, but still...blank columns until edited.

    Here's the code, does anything jump out as wrong:

    (I left out the ObjectDatasources)

    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
        <script type="text/javascript">
            var licenseRenderer = function (value) {
                var r = storLicenseTypes.getById(value);
    
                if (Ext.isEmpty(r)) {
                    return "";
                }
    
                return r.data.Name;
            };
        </script>
    
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
    
            <ext:ResourceManager ID="ResourceManager1" runat="server" />
    
            <ext:Store ID="storLicenseTypes" runat="server" DataSourceID="objDSLicenseTypes" >
                <Reader>
                    <ext:JsonReader IDProperty="CodeID">
                        <Fields>
                            <ext:RecordField Name="LicenseTypeID" Mapping="CodeID" Type="Int" />
                            <ext:RecordField Name="LicenseType" Mapping="CodeData" Type="String" />
                        </Fields>
                    </ext:JsonReader>
                </Reader>
            </ext:Store>
     
            <ext:Store ID="storInventoryItems" runat="server" DataSourceID="objDSInventoryItems">
                <Reader>
                    <ext:JsonReader IDProperty="InventoryItemID">
                        <Fields>
                            <ext:RecordField Name="InventoryItemID" Type="Int" />
                            <ext:RecordField Name="LicenseTypeID" Type="Int" />
                            <ext:RecordField Name="LicenseType" Type="String" />
                        </Fields>
                    </ext:JsonReader>
                </Reader>
            </ext:Store>
    
            <ext:GridPanel
                runat="server"
                EnableViewState="true"
                ID="grdInventoryItems"
                Title="Inventory Items"
                frame="true"
                Height="800"
                StoreID="storInventoryItems" >
            <ColumnModel runat="server" ID="ctl08">
                <Columns>
                    <ext:Column ColumnID="colInventoryItemID" DataIndex="InventoryItemID" />
                    <ext:Column ColumnID="colLicenseTypeID" DataIndex="LicenseTypeID" Editable="false" />
                    <ext:Column ColumnID="colLicenseType" Header="License Type"  DataIndex="LicenseTypeID">
                        <Renderer Fn="licenseRenderer" />
                        <Editor>
                            <ext:ComboBox runat="server" ID="cmbLicenseTypeID"
                            Shadow="Drop"
                            Mode="Local"
                            TriggerAction="All"
                            ForceSelection="true"
                            StoreID="storLicenseTypes" 
                            DisplayField="LicenseType" 
                            ValueField="LicenseTypeID">
    <Template Visible="False" ID="ctl84" EnableViewState="False"></Template>
                            </ext:ComboBox>
                        </Editor>
                    </ext:Column>
                </Columns>
            </ColumnModel>
            <SelectionModel>
                <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" />
            </SelectionModel>
        </ext:GridPanel>
    
         </div>
        </form>
    </body>
    </html>
  2. #2
    Hi dmoore,

    Your configuration appears to be configured properly.

    I have one guess that one or both are "data bound" incorrectly.

    So, could you provide a full sample code to reproduce without dependencies from database?
  3. #3
    Hi,

    Your storeLicenseTypes doesn't have 'Name' field but you use Name in the renderer
    return r.data.Name;
    I guess that you have to use
    return r.data.LicenseType;
  4. #4
    I came back to this thread to reply that I had discovered this same bug, only to see you had beat me to it!

    Thanks guys.

Similar Threads

  1. [CLOSED] How does "MaskCls" work for "AutoLoad" mask in panel control
    By leon_tang in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Jul 19, 2012, 12:09 PM
  2. Replies: 1
    Last Post: Jun 26, 2012, 11:29 AM
  3. Replies: 5
    Last Post: May 02, 2012, 5:37 PM
  4. Replies: 4
    Last Post: Oct 11, 2011, 2:42 AM
  5. Replies: 2
    Last Post: Jun 26, 2011, 1:59 AM

Posting Permissions