[CLOSED] Grid Render Cell is empty

  1. #1

    [CLOSED] Grid Render Cell is empty

    hi guys,

    I am trying to render the country name instead of the country code. I fellowed the example for data editing. It doesn't render the country name. I put alert in the function and it shows the correct country. I check the source code and both sores shows "US" I put the Editor and
    the combbox shows the right country. But the cell come empty
    because r.data.Name; come null.

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

    <script type="text/javascript">
        var countryRenderer = function (value) {
            var r = <%=strCountry.ClientID%>.getById(value);
            
            if (Ext.isEmpty(r)) {
                return "";
            }
            
            return r.data.Name;
        };
    </script>
    
    <ext:ResourceManager ID="script" runat="server" />
    
    <asp:Label ID="lblPageTitle" runat="server" Text="Manage Surveys" CssClass="pageTile" />
    
    <br />
    
    <ext:Store ID="strCountry" runat="server">
        <Reader>
            <ext:JsonReader >
                <Fields>
                    <ext:RecordField Name="ID" />
                    <ext:RecordField Name="Name" />
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>
    
    <ext:Store ID="Store1" runat="server">
        <Reader>
            <ext:JsonReader>
                <Fields>
                    <ext:RecordField Name="Survey_id" />
                    <ext:RecordField Name="Survey_name" />
                    <ext:RecordField Name="Country_code" />
                    <ext:RecordField Name="Survey_Currency" />
                    <ext:RecordField Name="Comments" />
                    <ext:RecordField Name="Modified_date" Type="Date" />
                    <ext:RecordField Name="Modified_By" />
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>
    
    <ext:GridPanel ID="grSurveyList" runat="server" StoreID="Store1"
    Title="Survey List" Width="850" Height="500">
        <TopBar>
            <ext:Toolbar ID="tbAdd" runat="server">
                <Items>
                    <ext:ToolbarSeparator />
                    <ext:Button runat="server" ID="btnAddSurevy" Icon="Add" Text="Add New Suevey">
                        <Listeners>
                            <Click Handler="openWindow();" />
                        </Listeners>
                    </ext:Button>
                </Items>
            </ext:Toolbar>
        </TopBar>
        <ColumnModel runat="server">
            <Columns>
                <ext:Column DataIndex="Survey_id" Hidden="true" Fixed="true" />
                <ext:Column DataIndex="Survey_name" Header="Survey Name" Width="220" />
                <ext:Column DataIndex="Country_code" Header="Country" >
                    <Renderer Fn="countryRenderer" />
                    <Editor>
                        <ext:ComboBox ID="cmbCountryUpdate" runat="server" Shadow="Drop" Mode="Local" TriggerAction="All" ForceSelection="true"
                        StoreID="strCountry" DisplayField="Name" ValueField="ID">
                        </ext:ComboBox>
                    </Editor>
                </ext:Column>
                <ext:Column DataIndex="Survey_Currency" Header="Currency" />
                <ext:Column DataIndex="Comments" Header="Comments" Width="220" />
                <ext:DateColumn DataIndex="Modified_date" Header="Modify Date" Format="MM/dd/yyyy" />
                <ext:Column DataIndex="Modified_By" Header="Modify By" />
            </Columns>
        </ColumnModel>
        <SelectionModel >
            <ext:RowSelectionModel runat="server" />
        </SelectionModel>
        <Plugins>
                <ext:GridFilters ID="fltSurveys" runat="server" Local="true">
                <Filters>
                    <ext:StringFilter DataIndex="Name" />
                </Filters>
            </ext:GridFilters>
        </Plugins>
    </ext:GridPanel>
  2. #2

    RE: [CLOSED] Grid Render Cell is empty

    I fixed it

    I was missing IDProperty="ID"

Similar Threads

  1. Replies: 4
    Last Post: Jul 10, 2012, 5:35 PM
  2. Render html in gridpanel cell?
    By Tbaseflug in forum 2.x Help
    Replies: 1
    Last Post: May 17, 2012, 2:52 PM
  3. [CLOSED] GridPanel Dynamic Cell Render
    By VALUELAB in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: May 17, 2011, 10:39 AM
  4. [CLOSED] Render (or prepare) grid cell
    By GmServizi in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Nov 24, 2009, 7:54 AM
  5. Replies: 2
    Last Post: Feb 19, 2009, 2:02 PM

Posting Permissions