1. #1
    Ext User
    Join Date
    Mar 2007
    Posts
    61
    Vote Rating
    0
    steven is on a distinguished road

      0  

    Default Grid Single Selection only?

    Grid Single Selection only?


    Hi. I have just started using Ext 1.0 and the grid and I'm still trying to understand how it all works.

    For some of my grids I want to restrict the selection to only allow a single row to be selected. What is the "correct" way of doing this? Is there a property I can set or do I need to handle an event to prevent multiple selection from occurring?

  2. #2
    Ext User
    Join Date
    Mar 2007
    Posts
    140
    Vote Rating
    0
    Belgabor is on a distinguished road

      0  

    Default


    Code:
    var sm = new Grid.RowSelectionModel({singleSelect:true});
    Belgabor's Ext Playground - Showcase for my Extensions

  3. #3
    Ext User
    Join Date
    Mar 2007
    Posts
    61
    Vote Rating
    0
    steven is on a distinguished road

      0  

    Default


    That works, thanks! (Except I did new Ext.grid.RowSelectionModel...)

  4. #4
    Ext User
    Join Date
    Mar 2007
    Posts
    140
    Vote Rating
    0
    Belgabor is on a distinguished road

      0  

    Default


    Ah sorry, I copy&pasted from my source and missed that I had used a shortcut
    Belgabor's Ext Playground - Showcase for my Extensions

  5. #5
    Ext JS Premium Member rule3's Avatar
    Join Date
    Apr 2008
    Posts
    152
    Vote Rating
    0
    rule3 is on a distinguished road

      0  

    Default


    Why do you people always gives only these "NON WORKING CODES"?

    Why do you not giving fully functinal code?

    1. Including whole script with modification..

    I have no absoletley time to investigage where HELL i must place that code anf how and what other scripting I must to do..

    Sorry about my anger..

    But if you give the whole code here and with web example I am aple to solve my coding problems faster..

  6. #6
    Sencha User
    Join Date
    Nov 2009
    Posts
    2
    Vote Rating
    1
    mccunea is on a distinguished road

      0  

    Default What you need and where!

    What you need and where!


    In the definition of your Ext.grid.GridPanel object include the follow property.

    selModel: new Ext.grid.RowSelectionModel({singleSelect: true}),

    Remembering to only include the comma at the end if there is another property to follow; some browsers let this go, some(IE) don't. The selModel property of the GridPanel object is itself an object; of type RowSelectionModel by default. We are constructing a RowSelectionModel object and defining a single property singleSelect = true.

Similar Threads

  1. Detecting single/multiple select in grid
    By arnair in forum Ext 1.x: Help & Discussion
    Replies: 3
    Last Post: 16 Jul 2007, 11:00 PM
  2. set/change backgroundcolor of a single cell in grid
    By humpdi in forum Ext 1.x: Help & Discussion
    Replies: 4
    Last Post: 10 May 2007, 5:40 AM
  3. EditorGrid Single Selection Model bug?
    By coltsfan2k in forum Ext 1.x: Bugs
    Replies: 1
    Last Post: 23 Mar 2007, 4:17 PM
  4. Single json post for a grid and a JsonView
    By BernardChhun in forum Ext 1.x: Help & Discussion
    Replies: 2
    Last Post: 5 Jan 2007, 10:28 AM
  5. How to listen to grid selection changes?
    By gcsolaroli in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 14 Dec 2006, 12:19 AM

Thread Participants: 3