Sep 29, 2014, 3:42 PM
[CLOSED] Editable gridpanel not rendering dropdownfield value
Hello!
I have a Gridpanel that uses the rowediting plugin. In one of the fields, i have a dropdownfield that contains a Gridpanel for choosing a certain item. I use the same renderer that's used for the combobox at https://examples2.ext.net/#/GridPane...Field_Mapping/, but it does not display a value in the dropdownfield once it goes into edit mode. The renderer does work for displaying the value in the unedited Grid though. Here's a simplified version of the markup and renderer I'm using(I removed other columns from the grid)
Thanks in advance for your help.
I have a Gridpanel that uses the rowediting plugin. In one of the fields, i have a dropdownfield that contains a Gridpanel for choosing a certain item. I use the same renderer that's used for the combobox at https://examples2.ext.net/#/GridPane...Field_Mapping/, but it does not display a value in the dropdownfield once it goes into edit mode. The renderer does work for displaying the value in the unedited Grid though. Here's a simplified version of the markup and renderer I'm using(I removed other columns from the grid)
<ext:Store runat="server" ID="EmployeeEmpStore"
PageSize="10"
RemoteSort="true"
OnReadData="deReadEmployeeData" AutoLoad="true">
<Model>
<ext:Model ID="Model1" runat="server" IDProperty="PERSON_ID">
<Fields>
<ext:ModelField Name="PERSON_ID" Type="Int" />
<ext:ModelField Name="EMPLOYEE_NAME" Type="String" />
<ext:ModelField Name="JOB_NAME" Type="String" />
</Fields>
</ext:Model>
</Model>
<Proxy>
<ext:PageProxy />
</Proxy>
<Listeners>
<Load Handler="#{uxEmployeeGrid}.getView().refresh()" />
</Listeners>
</ext:Store>
<ext:GridPanel runat="server"
ID="uxEmployeeGrid"
Title="Employees"
PaddingSpec="10 10 30 10"
MaxWidth="1200">
<Store>
<ext:Store runat="server"
ID="uxEmployeeStore">
<Model>
<ext:Model ID="Model2" runat="server" Name="Employee" IDProperty="PERSON_ID">
<Fields>
<ext:ModelField Name="EMPLOYEE_ID" />
<ext:ModelField Name="PERSON_ID" />
<ext:ModelField Name="EMPLOYEE_NAME" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel>
<Columns>
<Editor>
<ext:DropDownField runat="server" Editable="false"
ID="uxAddEmployeeEqDropDown"
Mode="ValueText"
AllowBlank="true" Width="500">
<Component>
<ext:GridPanel runat="server"
ID="uxAddEmployeeEqGrid"
Layout="HBoxLayout" StoreID="uxAddEmployeeEqStore">
<ColumnModel>
<Columns>
<ext:Column ID="Column12" runat="server" Text="Name" DataIndex="NAME" Flex="15" />
<ext:Column ID="Column42" runat="server" Text="Class Code" DataIndex="CLASS_CODE" Flex="35" />
<ext:Column ID="Column43" runat="server" Text="Project Number" DataIndex="SEGMENT1" Flex="20" />
<ext:Column ID="Column44" runat="server" DataIndex="ODOMETER_START" Text="Starting Units" Flex="15" />
<ext:Column ID="Column45" runat="server" DataIndex="ODOMETER_END" Text="Ending Units" Flex="15" />
</Columns>
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel Mode="Single" />
</SelectionModel>
<DirectEvents>
<SelectionChange OnEvent="deStoreGridValue">
<ExtraParams>
<ext:Parameter Name="EquipmentId" Value="#{uxAddEmployeeEqGrid}.getSelectionModel().getSelection()[0].data.EQUIPMENT_ID" Mode="Raw" />
<ext:Parameter Name="Name" Value="#{uxAddEmployeeEqGrid}.getSelectionModel().getSelection()[0].data.NAME" Mode="Raw" />
<ext:Parameter Name="Type" Value="EquipmentAdd" />
</ExtraParams>
</SelectionChange>
</DirectEvents>
</ext:GridPanel>
</Component>
<Listeners>
<Expand Handler="this.picker.setWidth(500);" />
</Listeners>
</ext:DropDownField>
</Editor>
<Renderer Fn="EmpEquipRenderer" />
</ext:Column>
<ext:Column ID="Column9" runat="server" DataIndex="PERSON_ID" Text="Employee Name" Flex="13">
<Renderer Fn="EmployeeRenderer" />
<Editor>
<ext:DropDownField runat="server"
ID="EmployeeEmpDropDown"
Mode="ValueText"
AllowBlank="false"
Editable="false" Width="500" InvalidCls="allowBlank">
<Component>
<ext:GridPanel runat="server"
ID="EmployeeEmpGrid"
Layout="HBoxLayout"
StoreID="EmployeeEmpStore">
<ColumnModel>
<Columns>
<ext:Column ID="Column6" runat="server" Text="Person ID" DataIndex="PERSON_ID" Flex="20" />
<ext:Column ID="Column7" runat="server" Text="Name" DataIndex="EMPLOYEE_NAME" Flex="40" />
<ext:Column ID="Column8" runat="server" Text="Job Name" DataIndex="JOB_NAME" Flex="40" />
</Columns>
</ColumnModel>
<BottomBar>
<ext:PagingToolbar ID="PagingToolbar1" runat="server" />
</BottomBar>
<SelectionModel>
<ext:RowSelectionModel ID="RowSelectionModel1" runat="server" Mode="Single" />
</SelectionModel>
<DirectEvents>
<SelectionChange OnEvent="StoreGridValue">
<ExtraParams>
<ext:Parameter Name="PersonId" Value="#{uxAddEmployeeEmpGrid}.getSelectionModel().getSelection()[0].data.PERSON_ID" Mode="Raw" />
<ext:Parameter Name="Name" Value="#{uxAddEmployeeEmpGrid}.getSelectionModel().getSelection()[0].data.EMPLOYEE_NAME" Mode="Raw" />
<ext:Parameter Name="Type" Value="EmployeeAdd" />
</ExtraParams>
</SelectionChange>
</DirectEvents>
<Plugins>
<ext:FilterHeader runat="server" ID="EmployeeEmpFilter" Remote="true" />
</Plugins>
</ext:GridPanel>
</Component>
<Listeners>
<Expand Handler="this.picker.setWidth(500);" />
</Listeners>
</ext:DropDownField>
</Editor>
</ext:Column>
</Columns>
</ColumnModel>
<Plugins>
<ext:RowEditing runat="server" ClicksToMoveEditor="1" AutoCancel="false" ID="test">
<DirectEvents>
<Edit OnEvent="deSaveEmployee" Before="return #{EmployeeStore}.isDirty();">
<ExtraParams>
<ext:Parameter Name="data" Value="#{EmployeeStore}.getChangedData({skipIdForPhantomRecords : false})" Mode="Raw" Encode="true" />
</ExtraParams>
<EventMask ShowMask="true" />
</Edit>
</DirectEvents>
</ext:RowEditing>
</Plugins>
</ext:GridPanel>
And here is my renderervar EmployeeRenderer = function (value) {
var r = App.EmployeeStore.getById(value);
if (Ext.isEmpty(r)) {
return "";
}
return r.data.EMPLOYEE_NAME;
};
I've noticed that if I set the dropdownfield to Text instead of ValueText, the PERSON_ID will display on edit, but no matter what I've tried, ValueText mode will not display anything.Thanks in advance for your help.
Last edited by Daniil; Oct 10, 2014 at 3:39 PM.
Reason: [CLOSED]