Jan 24, 2011, 3:31 PM
[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)
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>