[CLOSED] Store.add + grouped GridPanel issue

  1. #1

    [CLOSED] Store.add + grouped GridPanel issue

    Hello.

    I faced with problem, when add more, then one record in the store. Find example below

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="StoreAddTest.aspx.cs" Inherits="ExtJSTesApplication.StoreAddTest" %>
    <%@ Import Namespace="System.Xml" %>
    
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <script type="text/javascript">
    var storeLoaded = false;
    function loadStore(store) {
    if (!storeLoaded) {
    var recordsToAdd = [];
    recordsToAdd.push(new store.model({
    Id: 1,
    CapabilityName: 'cap1',
    CategoryName: 'cat'
    }));
    // If comment folowwing model insertion, then error was not occured
    recordsToAdd.push(new store.model({
    Id: 2,
    CapabilityName: 'cap2',
    CategoryName: 'cat'
    }));
    //-----------------
    
    
    store.add(recordsToAdd);
    }
    storeLoaded = true;
    }
    
    
    </script>
    </head>
    <body>
        <form id="form1" runat="server">
        <ext:ResourceManager ID="ResourceManager1" runat="server" />
            
    <ext:Store ID="CapabilitiesStore" runat="server" GroupField="CategoryName">
            <Model>
                <ext:Model ID="Model1" runat="server" IDProperty="Id">
                    <Fields>
                        <ext:ModelField Name="Id" Mapping="CapabilityId" />
                        <ext:ModelField Name="CapabilityName" />
    <ext:ModelField Name="CategoryName" SortType="AsUCString" />
                    </Fields>
                </ext:Model>
            </Model>
    <Sorters>
    <ext:DataSorter Property="CapabilityNameSort" Direction="ASC" />
    </Sorters>
    <Listeners>
    <Load Handler="loadStore(this)" />
    </Listeners>
        </ext:Store>
    
    
            <ext:GridPanel ID="AvailableCapabilitiesGrid"
    runat="server"
    StoreID="CapabilitiesStore"
    Collapsible="false"
    TitleCollapse="true"
    Frame="false"
    AutoScroll="True"
    Collapsed="False"
    ScrollDelta="16"
    ForceFit="true"
    Flex="4">
    <TopBar>
    <ext:Toolbar ID="AvailableCapabilitiesToolbar" runat="server" Height="27" StyleSpec="padding-top:6px;">
    <Items>
    <ext:Label ID="AvailableCapabilitiesGridToolbarLabel" runat="server" Text="Available Capabilities" Cls="labelTitle" />
    </Items>
    </ext:Toolbar>
    </TopBar>
    <ColumnModel ID="AvailableCapabilitiesColumnModel" runat="server">
    <Columns>
    <ext:Column ID="Column1" runat="server" Text="Capability" Width="250" DataIndex="CapabilityNameSort" Sortable="false" Groupable="false" MenuDisabled="true">
    
    </ext:Column>
    <ext:Column ID="Column2" runat="server" Text="Capability Group" Width="50" DataIndex="CategoryName" Groupable="false" />
    </Columns>
    </ColumnModel>
    <SelectionModel>
    <ext:CheckboxSelectionModel ID="AvailableCapabilitiesSelectionModel" runat="server" Mode="Simple" ShowHeaderCheckbox="false" />
    </SelectionModel>
    <View>
    <ext:GridView ID="GroupingView3" runat="server"
    TrackOver="true"
    StripeRows="true" />
    </View>
    <Features>
    <ext:Grouping ID="Grouping1" runat="server"
    HideGroupedHeader="true"
    GroupHeaderTplString='{name}' />
    </Features>
    </ext:GridPanel>
        </form>
    </body>
    </html>

    Could you help me to solve this issue?
    Last edited by Daniil; Sep 03, 2012 at 5:11 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Please edit the post wrapping the code in [CODE ] tags.

    For now we can suggest the following workaround: replace
    store.add(recordsToAdd);
    with
    grid.getView().blockRefresh = true;
    store.add(recordsToAdd);
    grid.getView().blockRefresh = false;
    grid.getView().refresh();
    You should also pass the "grid" (or directly its view) into the loadStore function.

    Though it looks like a bug. We will investigate further and come back with an update.
    Last edited by Daniil; Aug 29, 2012 at 10:11 AM.
  3. #3
    Thank you, Daniil.
    It works for me.
  4. #4
    It has been fixed in SVN. After update from the 2.1 branch, you can remove the workaround.

    Thanks again for the report!

Similar Threads

  1. [CLOSED] Order of grouped gridpanel rows
    By Pablo_Azevedo in forum 1.x Premium Help
    Replies: 9
    Last Post: Sep 22, 2011, 8:24 PM
  2. [CLOSED] Remove +- from grouped GridPanel
    By rthiney in forum 1.x Premium Help
    Replies: 4
    Last Post: Jun 14, 2011, 2:59 PM
  3. [CLOSED] FocusRow() for grouped GridPanel within DirectMethod
    By csharpdev in forum 1.x Premium Help
    Replies: 1
    Last Post: Nov 10, 2010, 2:21 PM
  4. Replies: 1
    Last Post: Feb 24, 2010, 3:05 PM
  5. Grouped grid very slow
    By testix in forum 1.x Help
    Replies: 3
    Last Post: Sep 19, 2009, 1:46 PM

Tags for this Thread

Posting Permissions