[CLOSED] GridPanel.getView().toggleRowIndex

  1. #1

    [CLOSED] GridPanel.getView().toggleRowIndex

    Hi Danil,

    gridPanel1.getView().toggleRowIndex(0);
    is resulting an error as 'toggleRowIndex 'method not found ( fron javascript)

    my code is :
    here is the listner for the store
    <Listeners>
                <Load Handler="if (records.length > 0) {gridPanel1.getView().toggleRowIndex(0);} " Single="true" />
    </Listeners>
    this is used to work in in v1.x and it is not working when we migrated to v2.5

    Thanks in Advance.
    Last edited by Daniil; Jun 25, 2014 at 10:53 AM. Reason: Please use [CODE] tags, [CLOSED]
  2. #2
    Any update please.....
  3. #3
    Hi @iansriley,

    In the future posts, please wrap the code in [CODE] tags.

    As for the toggleRowIndex method, please look at this thread. It looks that member had a similar problem.
    http://forums.ext.net/showthread.php?18705
    Last edited by Daniil; Jun 24, 2014 at 10:03 PM.
  4. #4
    This has not fixed my problem with workaround solution . and bit difficult to understand the secnha solution .

    My requirement is that expand first group only from the grid. Here is my code as

      var LoadStore = function (records) {    try {
            if (records.length > 0) {
                gridPanelLetters.getView().toggleRowIndex(0);  // to expand the first group row
            }
        }
        catch (e) {
    
    
        }
    
    
    }
    Called from store while loading the data
    <ext:Store ID="store2" runat="server" AutoLoad="false" GroupField="SortByCustomer">
            <Model>
                <ext:Model ID="Model1" runat="server">
                    <Fields>
    
    
                        <ext:ModelField Name="Name" />
                        <ext:ModelField Name="Author" />
                        <ext:ModelField Name="CreateDate" Mapping="CreateDate" Type="Date" />
                        <ext:ModelField Name="FirstName" />
                        <ext:ModelField Name="LastName" />
                        <ext:ModelField Name="SortByCustomer" />
    
    
                  
                    </Fields>
                </ext:Model>
            </Model>
            <Listeners>
                <Load Handler="LoadStore(records)" Single="true" />
            </Listeners>
        </ext:Store>
    Grid Panel code was :
    
    <ext:GridPanel ID="gridPanelLetters" runat="server" StoreID="store2" Title=""
                          HideHeaders="false" 
                           >
                            <ColumnModel ID="ColumnModel2" runat="server">
                                <Columns>
                                
                                    <ext:Column ID="Name" Flex="1" Text="Template Name" DataIndex="Name" runat="server" />
                                  
                                    <ext:Column ID="CreateDate" Text="Date Created" DataIndex="CreateDate" Align="Center"
                                        Width="80" Resizable="false" runat="server">
                                        <Renderer Handler="return Ext.util.Format.date(value, HiddenDateFormat.value);" />
                                    </ext:Column>
                                </Columns>
                            </ColumnModel>
                            <SelectionModel>
                                <ext:CheckboxSelectionModel ID="CheckboxSelectionModel1" runat="server" Mode="Single">
                                    <Listeners>
                                        <SelectionChange Fn="letterSelected">
                                        </SelectionChange>
                                    </Listeners>
                                </ext:CheckboxSelectionModel>
                            </SelectionModel>
                            <View>
                                <ext:GridView ID="gridPanelLetters_View" runat="server" StripeRows="true" TrackOver="true">
                                </ext:GridView>
                            </View>
                            <Features>
                                <ext:Grouping ID="gridPanelLetters_feature1" HideGroupedHeader="true" runat="server"
                                    StartCollapsed="true" GroupHeaderTplString='{[values.rows[0].data.Author]}'>
                                </ext:Grouping>
                            </Features>
                          
                          
                        </ext:GridPanel>
    in this way it is not working .... then i added your workaround solution .

    for Grid
    <ext:GridPanel ID="gridPanelLetters" runat="server" StoreID="store2" Title=""
                          HideHeaders="false" 
                           >
                            <ColumnModel ID="ColumnModel2" runat="server">
                                <Columns>
                                
                                    <ext:Column ID="Name" Flex="1" Text="Template Name" DataIndex="Name" runat="server" />
                                  
                                    <ext:Column ID="CreateDate" Text="Date Created" DataIndex="CreateDate" Align="Center"
                                        Width="80" Resizable="false" runat="server">
                                        <Renderer Handler="return Ext.util.Format.date(value, HiddenDateFormat.value);" />
                                    </ext:Column>
                                </Columns>
                            </ColumnModel>
                            <SelectionModel>
                                <ext:CheckboxSelectionModel ID="CheckboxSelectionModel1" runat="server" Mode="Single">
                                    <Listeners>
                                        <SelectionChange Fn="letterSelected">
                                        </SelectionChange>
                                    </Listeners>
                                </ext:CheckboxSelectionModel>
                            </SelectionModel>
                            <View>
                                <ext:GridView ID="gridPanelLetters_View" runat="server" StripeRows="true" TrackOver="true">
                                </ext:GridView>
                            </View>
                            <Features>
                                <ext:Grouping ID="gridPanelLetters_feature1" HideGroupedHeader="true" runat="server"
                                    StartCollapsed="true" GroupHeaderTplString='{[values.rows[0].data.Author]}'>
                                </ext:Grouping>
                            </Features>
                           <Listeners>
                                <ViewReady Handler="this.features[0].collapseAll();" />
                            </Listeners>
                          
                        </ext:GridPanel>
    and Changed the LoadStore function as
     
    var LoadStore = function (records) {
        try {
            if (records.length > 0) {
                gridPanelLetters_feature1.expand('group1');
            }
        }
        catch (e) {
    
    
        }
    
    
    }
    then i getting an error in the " Cannot read property 'isCollapsed' of undefined".

    Solution will be appreciated, Thanks in advance.
    Last edited by iansriley; Jun 24, 2014 at 3:51 PM.
  5. #5
    gridPanelLetters_feature1.expand('group1');
    'group1' is the name of actual group in the Store. In that example the groups' names are 'group1' and 'group2'. It depends on the data that you bind to a Store's GroupField.
  6. #6

    [Closed] GridPanel.getView().toggleRowIndex

    Thanks this has been resolved after adding the workaround solution.

    you can update this thread as closed...
    Thanks.

Similar Threads

  1. Replies: 1
    Last Post: Dec 10, 2013, 10:57 AM
  2. Grid panel this.grid.getView().headerCt is null
    By xtremexploit in forum 2.x Help
    Replies: 3
    Last Post: May 29, 2012, 11:57 PM
  3. Replies: 4
    Last Post: Oct 11, 2011, 2:42 AM
  4. Replies: 2
    Last Post: Jul 25, 2011, 9:24 AM

Posting Permissions