Results 1 to 5 of 5

Thread: Is it possible to use SelectionModel() with EditorGridPanel ?

  1. #1

    Default Is it possible to use SelectionModel() with EditorGridPanel ?

    I try to use SelectionModel() with EditorGridPanel but it doesn't work

    Here the code:


    Code:
       var userExceptionForm = new Ext.grid.EditorGridPanel({
           
           id: 'userExceptionForm',
           el: 'userExceptionGridForm-el',
           title: 'Title',
           frame: true,
           labelAlign: 'left',
           bodyStyle:'padding:5px',
           width: 930,
           height: 350,
           layout: 'column',
           plugins: checkColumn,
           cm: colModel,
           store: userExceptionStore,
           
           listeners: { 
    
               rowselect: function(sm, row, rec) {
                   Ext.getCmp("userExceptionForm").getForm().loadRecord(rec);
                       
               viewready: function(g) {
                       g.getSelectionModel().selectRow(0);
                   } // Allow rows to be rendered.      
               }
           },
           items: [{columnWidth: 0.60,
                   layout: 'fit',
                   items: {
                       xtype: 'grid',
                    
                   
                       sm: new Ext.grid.RowSelectionModel({
                           singleSelect: true,
                           listeners: {
                               rowselect: function(sm, row, rec) {       
                                   userExceptionSelectedRow = rec.copy();                     
                                   Ext.getCmp("userExceptionForm").getForm().loadRecord(rec);
                               }
                           }
                       }),
                       //autoExpandColumn: 'secondedTo',
                       height: 350,
                       width: 580,
                       title:'<fmt:message key="sybiladmin.userExceptions.list"/>',
                       border: true,
                       listeners: {
                           viewready: function(g) {                        
                               g.getSelectionModel().selectRow(0);
                           } // Allow rows to be rendered.
                       }
                   }
               },
                   
                   
                   {
               columnWidth: 0.4,
               xtype: 'fieldset',
               labelWidth: 120,
               title:'<fmt:message key="sybiladmin.userException.details"/>',
               defaults: {width: 140, border:false},    // Default config options for child items
               defaultType: 'textfield',
               autoHeight: true,
               bodyStyle: Ext.isIE ? 'padding:0 0 5px 15px;' : 'padding:10px 15px;',
               border: false,
               style: {
                   "margin-left": "10px", // when you add custom margin in IE 6...
                   "margin-right": Ext.isIE6 ? (Ext.isStrict ? "-10px" : "-13px") : "0"  // you have to adjust for it somewhere else
               },
               items: [{
                   fieldLabel: 'userLogin',
                   name: 'userLogin'
               },{
                   fieldLabel: 'Service',
                   name: 'secondmentToServiceName'
               }
               ]
    
           }
           ]  
           
       });

    Thanks a lot for your help

  2. #2

    Default

    I try this but it doesn't work.
    What's wrong on this snippet ?
    Code:
    Defaults.config.Grid = {
        selModel: new Ext.grid.RowSelectionModel({
            singleSelect: true,
            moveEditorOnEnter: true
        })
    };
    
    newGrid = new Ext.grid.EditorGridPanel(Ext.apply(Defaults.config.grid,{blah blah blah}));

  3. #3
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364

    Default

    This is not a question for Sencha touch. Moving to Ext Help!

  4. #4

    Default

    Oups Your're right, sorry...

  5. #5
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    You can't share a selModel between grids, so you can't store it in Defaults. Instead you will have to create the selModel for each grid separately.

    ps. This is not only true for the selModel, but for any non-simple type config option.

Similar Threads

  1. Is SelectionModel really a Model?
    By nucleo in forum Community Discussion
    Replies: 0
    Last Post: 13 Dec 2008, 3:25 AM
  2. SelectionModel api
    By tomlobato in forum Ext 2.x: Help & Discussion
    Replies: 6
    Last Post: 1 Dec 2008, 7:52 PM
  3. SelectionModel error
    By lakehouse in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 5 Aug 2008, 10:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •