Mar 25, 2020, 3:55 PM
[CLOSED] Scroll to selected row in GridPanel
Hi
I have a DropDownField that shows a gridpanel with a id and a text. The dropdownfield has a start value which I select in the gridpanel (this works) by this code:
I tried with focusRow(), but I can't get it to work. I hope you can give me some help without a full example.
Mikael
I have a DropDownField that shows a gridpanel with a id and a text. The dropdownfield has a start value which I select in the gridpanel (this works) by this code:
App.gpEditUtforare.getSelectionModel().select(App.storeEditUtforare.find('ID', this.getValue()))
Then I want the gridpanel to scroll to that selected row.I tried with focusRow(), but I can't get it to work. I hope you can give me some help without a full example.
<ext:DropDownField runat="server">
<Listeners>
<Expand Handler="this.picker.setWidth(300); App.gpEditUtforare.getSelectionModel().select(App.storeEditUtforare.find('ID', this.getValue()))" />
</Listeners>
<Component>
<ext:GridPanel
runat="server"
ID="gpEditUtforare"
StripeRows="true"
Height="250"
Border="false"
Header="false"
ColumnLines="true">
<Store>
<ext:Store
ID="storeEditUtforare"
GroupField="ID"
runat="server">
<Model>
<ext:Model runat="server">
<Fields>
<ext:ModelField Name="ID" Type="String" />
<ext:ModelField Name="NAMN" Type="String" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel runat="server">
<Columns>
<ext:Column runat="server" Header="ID" Width="100" DataIndex="ID"></ext:Column>
<ext:Column runat="server" Header="Namn" Flex="1" DataIndex="NAMN"></ext:Column>
</Columns>
</ColumnModel>
<Listeners>
<RowClick Handler="this.dropDownField.setValue(record.data.ID);"></RowClick>
</Listeners>
</ext:GridPanel>
</Component>
</ext:DropDownField>
ThanksMikael
Last edited by fabricio.murta; Mar 26, 2020 at 7:18 PM.