2014-03-06 55 views
0

我有一個問題.. 我正在使用網格面板來顯示報告,並使用單元格選擇模塊。 我想前兩個中的值上的任何其他單元的選擇..ext.net如何在單元格選擇gridpanel上從一行中獲取兩個單元格的值?

我想上傳圖片,但它不是從我所用的IDproperty在店裏現場:)

接受,但我對他們有兩個問題, 1 - 它僅使用一列,而不是複合鍵.. 2 - 當我選擇的行之前摺疊組,該ID屬性返回錯誤值..

我有什麼辦法獲取第一列和第二列的值?

這裏是我的代碼..

<ext:GridPanel ClientIDMode="Static" RTL="false" Layout="FitLayout" ID="grdUsersRates" runat="server" MaxHeight="700" Padding="5" > 
       <HeaderConfig > 
        <Items> 
         <ext:Label ID="Label1" ClientIDMode="Static" Flex="4" runat="server" Text=""></ext:Label> 
         <ext:Label ID="Label2" ClientIDMode="Static" Flex="3" runat="server" Text="نتائج البحث"></ext:Label>        
        </Items> 
       </HeaderConfig> 
       <SelectionModel >       
        <ext:CellSelectionModel ID="cellSelectionModel1" runat="server" >      
         <DirectEvents > 
          <Select OnEvent="getCellTaxReturns"> 
           <ExtraParams> 
            <ext:Parameter Name="CurrentPageIndex" Value="#{grdSearchResult}.getStore().currentPage" Mode="Raw" /> 
            <ext:Parameter Name="PageSize" Value="#{grdSearchResult}.store.pageSize" Mode="Raw" /> 
           </ExtraParams> 
           <EventMask Msg="برجاء الإنتظار حتى يتم تحميل الإقرارات" ShowMask="true"> 

           </EventMask> 
          </Select> 
         </DirectEvents> 
        </ext:CellSelectionModel> 
       </SelectionModel>     
       <Store > 
        <ext:Store OnReadData="refreshGridView" ID="storeUserRates" runat="server" ClientIDMode="Static" GroupField="szScanUserName"> 
         <Model> 
          <ext:Model ID="Model4" runat="server" ClientIDMode="Static" > 
           <Fields> 
            <ext:ModelField Name="nScanUserId" /> 
            <ext:ModelField Name="szScanUserName" /> 
            <ext:ModelField Name="szTaxReturnCategoryCode" /> 
            <ext:ModelField Name="szTaxReturnCategoryDescr" /> 
            <ext:ModelField Name="nScanTaxReturnCount" /> 
            <ext:ModelField Name="nScanPaperCount" /> 
           </Fields> 
          </ext:Model> 
         </Model>        
        </ext:Store> 
       </Store>      
       <ColumnModel ID="ColumnModel2" runat="server" RTL="false" ClientIDMode="Static" > 
        <Columns> 
         <ext:SummaryColumn ID="clScanPaperCount" runat="server" Align="Center" Text="عدد الصفحات" Flex="3" DataIndex="nScanPaperCount" RTL="true" 
          SummaryType="Sum" 
         > 

         </ext:SummaryColumn> 

         <ext:SummaryColumn ID="clScanTaxReturnCount" runat="server" Align="Center" Text="عدد الإقرارات" Flex="3" DataIndex="nScanTaxReturnCount" RTL="true" 
                SummaryType="Sum"> 

         </ext:SummaryColumn> 

         <ext:Column runat="server" Align="Center" Text="نوع الإقرار" Flex="5" DataIndex="szTaxReturnCategoryDescr" RTL="true" ID="clReturnTypeName" > 
         </ext:Column> 

         <ext:Column Hidden="true" runat="server" Align="Center" Text="كود نوع الإقرار" Flex="5" DataIndex="szTaxReturnCategoryCode" RTL="true" ID="clReturnTypeCode" > 
         </ext:Column> 

         <ext:Column runat="server" Align="Center" Text="إسم المستخدم" Flex="5" DataIndex="szScanUserName" RTL="false" ID="clUserName" > 
         </ext:Column> 

         <ext:Column Hidden="true" runat="server" Align="Center" Text="رقم المستخدم" Flex="3" DataIndex="nScanUserId" RTL="true" ID="clUserID" > 
         </ext:Column> 

         <ext:RowNumbererColumn ID="serial" Flex="1" runat="server" Text="مسلسل" > 

         </ext:RowNumbererColumn> 
        </Columns> 
       </ColumnModel> 
       <TopBar> 
        <ext:Toolbar ID="Toolbar1" runat="server" RTL="true" >        
         <Items> 
          <ext:Button ID="btnShowTotalsOnly" runat="server" Text="إظهار الإجمالى فقط/إظهار التفاصيل" Icon="Anchor" 
           Handler="#{UserRatesGroupingSummary}[#{UserRatesGroupingSummary}.expanded ? 'collapseAll' : 'expandAll'](); #{UserRatesGroupingSummary}.expanded = !#{UserRatesGroupingSummary}.expanded;"></ext:Button> 

          <ext:ToolbarSpacer></ext:ToolbarSpacer> 
          <ext:ToolbarSeparator></ext:ToolbarSeparator> 
          <ext:ToolbarSpacer></ext:ToolbarSpacer> 

          <ext:Button ID="btnPrintFullGrid" runat="server" Text="طباعة الجدول" Icon="Printer" Handler="this.up('grid').print();"></ext:Button> 

          <ext:ToolbarSpacer></ext:ToolbarSpacer> 

          <ext:Button ID="btnPrintPageGrid" runat="server" Text="طباعة الصفحة الحالية فقط" Icon="Printer" Handler="this.up('grid').print({currentPageOnly : true });" /> 
          <ext:ToolbarSpacer></ext:ToolbarSpacer> 
          <ext:ToolbarSeparator></ext:ToolbarSeparator> 
          <ext:ToolbarSpacer></ext:ToolbarSpacer> 

          <ext:Button ID="btnExportToExcel" runat="server" Text="إستخراج نسخة Excel" Icon="PageExcel" ClientIDMode="Static" > 
           <Listeners> 
            <Click Fn="saveDataOfUserRates" /> 
           </Listeners> 
           <DirectEvents> 
            <Click OnEvent="mainToExcel" IsUpload="true"> 

            </Click> 
           </DirectEvents> 
          </ext:Button> 

          <ext:ToolbarSpacer></ext:ToolbarSpacer> 

          <ext:Button ID="btnExportToPDF" runat="server" Text="إستخراج نسخة PDF" Icon="PageAttach" ClientIDMode="Static" > 

           <DirectEvents> 
            <Click OnEvent="mainToPdf" IsUpload="true"></Click> 
           </DirectEvents> 
          </ext:Button> 
         </Items> 
        </ext:Toolbar> 
       </TopBar> 
<BottomBar> 
        <ext:PagingToolbar RTL="true" ID="grdPagingToolBar" runat="server" EmptyMsg="لا توجد بيانات متاحة الان" 
           BeforePageText="الصفحة" AfterPageText="من {0}" DisplayMsg="عرض {0} - {1} من{2}"> 
         <Items> 
          <ext:Label ID="lblPageSize" runat="server" Text="حجم الصفحة:"></ext:Label> 
          <ext:ToolbarSpacer ID="grdToolBarSpacer1" runat="server" Width="10"></ext:ToolbarSpacer> 
           <ext:ComboBox ID="cmbxPageSize" runat="server" Width="80"> 
            <Items> 
             <ext:ListItem Text="15" /> 
             <ext:ListItem Text="25" /> 
             <ext:ListItem Text="50" /> 
             <ext:ListItem Text="100" /> 
             <ext:ListItem Text="150" /> 
             <ext:ListItem Text="200" /> 
             <ext:ListItem Text="250" /> 
             <ext:ListItem Text="300" /> 
             <ext:ListItem Text="400" /> 
             <ext:ListItem Text="500" /> 
             <ext:ListItem Text="700" /> 
             <ext:ListItem Text="850" /> 
             <ext:ListItem Text="1000" /> 
             <ext:ListItem Text="120" /> 
             <ext:ListItem Text="1500" /> 
             <ext:ListItem Text="2000" /> 
            </Items> 
            <SelectedItems> 
             <ext:ListItem Value="25" /> 
            </SelectedItems> 
            <Listeners> 
             <Select Handler= 
             "#{grdUsersRates}.store.pageSize = parseInt(this.getValue(), 10); #{grdUsersRates}.store.reload();#{UserRatesGroupingSummary}[#{UserRatesGroupingSummary}.expanded ? 'collapseAll' : 'expandAll'](); #{UserRatesGroupingSummary}.expanded = !#{UserRatesGroupingSummary}.expanded;" /> 
            </Listeners> 
           </ext:ComboBox> 
          </Items> 
         <Plugins> 
          <ext:ProgressBarPager ID="grdProgressBarPager" runat="server" ></ext:ProgressBarPager> 
         </Plugins> 
        </ext:PagingToolbar> 
       </BottomBar> 
       <Features> 
        <ext:GroupingSummary ID="UserRatesGroupingSummary" ClientIDMode="Static" 
         runat="server" GroupHeaderTplString="{name}" 
           HideGroupedHeader="true" StartCollapsed="true" 
           EnableGroupingMenu="true" EnableNoGroups="true" GroupByText="grouping بهذا العمود" 
           ShowGroupsText="إظهار المجموعات Grouping" > 

        </ext:GroupingSummary> 
         <ext:Summary ID="Summary1" runat="server" />  
       </Features> 
      </ext:GridPanel> 

我需要得到這些有價值的方式,事件,如果有需要使用jquery ..

感謝

回答

2

的記錄被傳遞給根據the ExtJS docs的選擇事件。

因此,您可以獲取該記錄的任何字段。

<ext:Parameter Name="someField" Value="record.get('modelFieldName')" Mode="Raw" /> 
+0

感謝Daniil,它的工作完美! .. – haytham

相關問題