PDA

View Full Version : [CLOSED] grid panel listener for unselecting a row



blueworld
Feb 14, 2013, 7:45 AM
Hello.

I have a gridpanel with a selectionmodel. Selecting a row will add a specific layer to a map, and unselecting a row will remove that layer.
I know that there is a select and selectionChange handler.
What I need to know, is what column has been checked or unchecked at this moment. Looping trough the selections will not help because there are also "old" selections.
As well there may be the case, that row 1,4, and 5 are already selected. The user could now check the "check all" checkbox at the top of the grid, I would need a list off all other rows/records except 1,4 and 5.

I am not sure what would be the best way to handle that (client side)

Does someone have a good tip?





<ext:GridPanel ID="GridPanelTasks" runat="server" Header="false" Border="false">
<View>
<ext:GridView ID="GridView3" runat="server">
</ext:GridView>
</View>
<Store>
<ext:Store ID="CategoryStore" runat="server">
<Proxy>
<ext:PageProxy />
</Proxy>
<Model>
<ext:Model ID="Model5" runat="server" IDProperty="CategoryName">
<Fields>
<ext:ModelField Name="CategoryName" />
</Fields>
</ext:Model>
</Model>
<Parameters>

<ext:StoreParameter Name="TasksDatum" Value="App.DateField_Tasks.getValue()" Mode="Raw" />
</Parameters>
<Listeners>
<DataChanged Handler="getAllTasks(App.DateField_Tasks.getValue());" />

</Listeners>
</ext:Store>

</Store>

<ColumnModel>
<Columns>
<ext:Column ID="Column6" runat="server" Text="Routen" DataIndex="CategoryName" Sortable="True"
Flex="1" />
</Columns>
</ColumnModel>
<SelectionModel>
<ext:CheckboxSelectionModel ID="CheckboxSelectionModel2" runat="server" Mode="Multi">
</ext:CheckboxSelectionModel>
</SelectionModel>

</BottomBar>
<Listeners>
<Select Handler="categoryChange();" />
</Listeners>
</ext:GridPanel>

Daniil
Feb 14, 2013, 9:11 AM
Hi @blueworld,

I would use the SelectionChange event and save a "selected" argument is some property.

<SelectionChange Handler="this.previouslySelectedRecords = selected;" />

And compare that "previouslySelectedRecords" with the "selected" argument.

blueworld
Feb 14, 2013, 9:46 AM
Hi @blueworld,

I would use the SelectionChange event and save a "selected" argument is some property.

<SelectionChange Handler="this.previouslySelectedRecords = selected;" />

And compare that "previouslySelectedRecords" with the "selected" argument.

Hi Daniil,

thank you for the tip.
Currently I am thinking about using a command column with a toggle button instead of these checkboxes.
What I would need is a toggle/untoggle all button somewhere in my grid. Do you have an idea how I could loop trough that grid and toggle/untoggle all these commandbuttons?

Daniil
Feb 14, 2013, 1:39 PM
I would not recommend to use a CommandColumn for this task.

1. It is rather a heavyweight feature.

2. It would be not so easy to implement. Seems we discussed it here.
http://forums.ext.net/showthread.php?22896