[CLOSED] grid panel listener for unselecting a row

  1. #1

    [CLOSED] grid panel listener for unselecting a row

    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>
    Last edited by Daniil; Feb 19, 2013 at 3:43 AM. Reason: [CLOSED]
  2. #2
    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.
  3. #3
    Quote Originally Posted by Daniil View Post
    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?
  4. #4
    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

Similar Threads

  1. [CLOSED] Panel float & unfloat listener events
    By cwolcott in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Oct 05, 2012, 1:45 PM
  2. grid render event listener
    By [WP]joju in forum 1.x Help
    Replies: 1
    Last Post: Nov 05, 2009, 1:42 AM
  3. [CLOSED] Panel TitleChange listener
    By ashton.lamont in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Oct 19, 2009, 4:21 PM
  4. Replies: 1
    Last Post: Sep 11, 2009, 11:41 AM
  5. Replies: 4
    Last Post: Aug 10, 2009, 4:00 PM

Tags for this Thread

Posting Permissions