1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    25
    Vote Rating
    0
    akshar_jamgaonkar is on a distinguished road

      0  

    Default Unanswered: show a gird row selected depending upon coditions

    Unanswered: show a gird row selected depending upon coditions


    Hello All,

    I have a grid panel with

    selModel : Ext.create('Ext.selection.RowModel', {
    mode : 'SINGLE'
    })


    this grid panel is inside a formpanel, what i want is when it loads i show a specific row as selected. With every column of gridpanel associated with Renderer.


    I have tried many things like

    me.gridPanel.getSelectionModel().select(me.store.findRecord('id',1) )

    me.gridPanel.getSelectionModel().select(me.store.findRecord('id',1) .data)


    but iam unable to do this.


    Kindly let me know what mistake iam i doing...



    Thanks in advance.

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,918
    Answers
    655
    Vote Rating
    443
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Select is looking for an index, not a record return by findRecord

    Try the following:

    Code:
    Ext.create('Ext.data.Store', {
        storeId : 'simpsonsStore',
        fields  : ['name', 'email', 'change'],
        data    : {'items' : [
            { 'name' : 'Lisa',  'email' : 'lisa@simpsons.com',  'change' : 100  },
            { 'name' : 'Bart',  'email' : 'bart@simpsons.com',  'change' : -20  },
            { 'name' : 'Homer', 'email' : 'home@simpsons.com',  'change' : 23   },
            { 'name' : 'Marge', 'email' : 'marge@simpsons.com', 'change' : -11  }
        ]},
        proxy   : {
            type   : 'memory',
            reader : {
                type : 'json',
                root : 'items'
            }
        }
    });
    
    var grid = Ext.create('Ext.grid.Panel', {
        title      : 'Simpsons',
        store      : Ext.data.StoreManager.lookup('simpsonsStore'),
        columns    : [
            { header : 'Name', dataIndex : 'name' },
            { header : 'Email', dataIndex : 'email', flex : 1 },
            { header : 'Change', dataIndex : 'change' }
        ],
        height     : 200,
        width      : 400,
        renderTo   : Ext.getBody()
    });
    
    var index = grid.store.find('name','Bart');
    grid.getSelectionModel().select(index);
    ​
    Scott.

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi