How to use grooping in GridPanel with SqlDataSource?

  1. #1

    How to use grooping in GridPanel with SqlDataSource?



    I made it so:

    
    <asp:SqlDataSource ID="ds_if" runat="server" 
               ConnectionString="<%$ ConnectionStrings:warCString %>" 
                SelectCommand="SELECT DISTINCT [U_IdNom],[U_IdIF],[U_IdI],[T_Caption], [group], [M_Price], [I_Kolvo], [dt] FROM [v_incomefull] WHERE ([U_IdI] = @U_IdI) ORDER BY [T_Caption]">
               <SelectParameters>
                 <asp:QueryStringParameter Name="U_IdI" QueryStringField="id" DbType="Guid" />
               </SelectParameters>
            </asp:SqlDataSource>
            
            <ext:Store ID="NomGrid" runat="server" DataSourceID="ds_if" OnRefreshData="Nom_Refresh" GroupField="U_IdNom">
            <Reader>
            <ext:JsonReader>
                <Fields>
                <ext:RecordField Name="U_IdIF" />
                <ext:RecordField Name="U_IdNom" />
                <ext:RecordField Name="T_Caption" />
                <ext:RecordField Name="group" />
                <ext:RecordField Name="M_Price" />
                <ext:RecordField Name="I_Kolvo" />
                <ext:RecordField Name="dt" />
                </Fields>
            </ext:JsonReader>
            </Reader>
              <SortInfo Field="T_Caption" Direction="ASC" />
            </ext:Store>
      
     <ext:GridPanel ID="GridPanel1" runat="server" StoreID="NomGrid" AutoHeight="true"
                    Title="????????????" AutoExpandColumn="T_Caption" Collapsible="true" Frame="false">
                <ColumnModel runat="server">
                 <Columns>
                  <ext:Column Header="??????" ColumnID="group" DataIndex="group" Width="200" Groupable="true"></ext:Column>
                  <ext:Column Header="????????????" ColumnID="T_Caption" DataIndex="T_Caption" Width="200"
                      Sortable="true" Groupable="true" ></ext:Column>
                  <ext:Column Header="????" ColumnID="M_Price" DataIndex="M_Price" Width="75" Groupable="true"></ext:Column>
                  <ext:Column Header="??????????" ColumnID="I_Kolvo" DataIndex="I_Kolvo" Width="75" Groupable="true"></ext:Column>
                 </Columns>
                </ColumnModel>
                <LoadMask ShowMask="true" Msg="???????? ????????????"/>
                    <SelectionModel>
                         <ext:RowSelectionModel>
                             <AjaxEvents>
                               <RowSelect Buffer="250" OnEvent="SetIncomeFullIdValue">
                               <ExtraParams>
                                   <ext:Parameter Name="U_IdIF" Value="this.getSelected().get('U_IdIF')" Mode="Raw" />
                               </ExtraParams>
                               </RowSelect>
                             </AjaxEvents>
                         </ext:RowSelectionModel>
                    </SelectionModel>
                <View>
                    <ext:GroupingView ID="GroupingView1" HideGroupedColumn="true" runat="server" 
                        StartCollapsed="true" GroupTextTpl="return 'test GroupTextTpl'" EnableRowBody="false">
                        <Listeners>
                            <Refresh Fn="fullcapt" />
                        </Listeners>
                        <GetRowClass Handler="return 'test'" />
                    </ext:GroupingView>
                    </View>
                <BottomBar>
                 <ext:PagingToolBar 
                 StoreID="NomGrid" RefreshText="?????????? ?????? ????????????" 
                 Id="tlb" runat="server" DisplayMsg="???????????? ???????????? {0} - {1} ?? {2}"
                   EmptyMsg="??? ????????????.">
                 </ext:PagingToolBar>
                </BottomBar>
                <Buttons>
                <ext:Button runat="server" ID="btn_Add" Text="????????">
                <AjaxEvents>
                <Click OnEvent="OpenAddNom" ></Click>
                </AjaxEvents>
                </ext:Button>
                <ext:Button runat="server" ID="btn_del" Text="???????">
                  <AjaxEvents>
                   <Click OnEvent="DeleteIncById" ></Click>
                  </AjaxEvents>
                </ext:Button>
                </Buttons>
                </ext:GridPanel> 
      
        <script type="text/javascript">
            var fullcapt = function(value, metadata, record, rowIndex, colIndex, store) {
                return '' + record.data.T_Caption + '';
            };
        </script>
    But it isn?t working.
    Error messages :
    1. "Line: 149 Error: 'hidden' is null or not an object". In JavaScript selected "if(C.hidden!==B)";
    2. Line: 145 Error: 'groupRenderer' is null or not an object.



    Do you have any ideas?
  2. #2

    RE: How to use grooping in GridPanel with SqlDataSource?

    *Hi,

    The following example should be helpful.


    https://examples1.ext.net/#/GridPane...eous/Grouping/



  3. #3

    RE: How to use grooping in GridPanel with SqlDataSource?

    I am getting the same error here - modeled it after the example
  4. #4

    RE: How to use grooping in GridPanel with SqlDataSource?

    Hi,

    Please note that*a column with DataIndex equals GroupField*must be exists in ColumnModel
  5. #5

    RE: How to use grooping in GridPanel with SqlDataSource?

    Thanks - I just hit that myself - is there a way to use the groupsummary but not show the data grouped? Just a row level summary?

Similar Threads

  1. GridPanel Remote Paging with SqlDatasource
    By Aod47 in forum 1.x Help
    Replies: 1
    Last Post: Oct 25, 2013, 6:00 AM
  2. [CLOSED] Gridpanel->update->SqlDatasource
    By showingg in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 13, 2012, 4:29 PM
  3. Replies: 0
    Last Post: Oct 08, 2011, 8:02 PM
  4. Editing GridPanel attached to a SQLDatasource
    By tnwheeler in forum 1.x Help
    Replies: 2
    Last Post: Aug 30, 2010, 9:58 PM
  5. Updating sqldatasource of GridPanel
    By sachin.munot in forum 1.x Help
    Replies: 8
    Last Post: May 30, 2009, 9:07 PM

Posting Permissions