Feb 28, 2010, 2:17 AM
[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/
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>