[1.0] Selected Record in a GridPanel

  1. #1

    [1.0] Selected Record in a GridPanel

    Hi,

    I have the following code in a gridpanel:
    <ext:GridPanel ID="gridp" runat="server" StoreID="store_empl" StripeRows="true" 
                                 TrackMouseOver="true"  AutoExpandColumn="name">
                                
        <ColumnModel runat="server">
           <Columns>                                                                                             
               <ext:Column ColumnID="code" Header="Code" DataIndex="getCode" />
               <ext:Column ColumnID="name" Header="Name" DataIndex="getName" />                                                                  
           </Columns>
        </ColumnModel>  
                       
        <SelectionModel>
           <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true">                           
                <DirectEvents>
                    <RowSelect OnEvent="RowSelect">
                         <ExtraParams>
                             <ext:Parameter Name="SelectedRecord" Value="Ext.encode(#{gridp}.getRowsValues())" Mode="Raw" />
                          </ExtraParams>
                    </RowSelect>     
                </DirectEvents>                                       
           </ext:RowSelectionModel>
        </SelectionModel>
    </ext:GridPanel>
    This works fine on version 0.8.2 but it doesn't work in Ext.NET (v. 1.0).
    Ext.encode(#{gridp}.getRowsValues() returns all the rows of the grid (and not only selected row).
    What can i do?
    Last edited by walle; Nov 07, 2010 at 6:24 PM.
  2. #2
    Hi,

    <ext:Parameter Name="SelectedRecord" Value="Ext.encode(#{gridp}.getRowsValues({selectedOnly:true}))" Mode="Raw" />
    Info about config object are passed to getRowsValues method
    // config :
    // - selectedOnly
    // - visibleOnly
    // - dirtyCellsOnly
    // - dirtyRowsOnly
    // - currentPageOnly
    // - filterRecord - function (record) - return false to exclude the record
    // - filterField - function (record, fieldName, value) - return false to exclude the field for particular record
  3. #3
    Hi Vladimir,

    Perfect ! That works fine.

    But, where can i find the Info about config object for next time?
    Last edited by walle; Nov 08, 2010 at 12:44 PM.
  4. #4
    Hi Vladimir,

    I already use your code. It working fine for me but when I use RemotePaging="false" -> I cannot got the grid panel value. It always NULL.

Similar Threads

  1. [CLOSED] get record values of the selected combobox item
    By marco.morreale in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Jun 20, 2012, 1:22 PM
  2. [CLOSED] How to change record values of selected rows?
    By macap in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Jul 30, 2010, 12:29 PM
  3. How to get id of record for selected row in GridPanel?
    By Yanfang Wang in forum 1.x Help
    Replies: 2
    Last Post: Jun 13, 2010, 3:06 AM
  4. Replies: 2
    Last Post: Jan 07, 2010, 3:54 PM
  5. [CLOSED] How to jump to selected record when GridPanel reloads?
    By iansriley in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Mar 10, 2009, 11:55 AM

Posting Permissions