1. #1
    Sencha User
    Join Date
    Sep 2012
    Posts
    55
    Vote Rating
    0
    bunty is on a distinguished road

      0  

    Default Answered: Ext.selection.CheckboxModel help needed

    Answered: Ext.selection.CheckboxModel help needed


    I want to get the 1st column value when i select a row. below code is returning me undefined.


    Code:
    var sm = Ext.create('Ext.selection.CheckboxModel',{    	listeners: {
                select: function(this1, record,  index, eOpts ){
                    alert(record.get(index));
                }
        	}    	
        });
    need inputs.

  2. Code:
    alert(record.get(company));
    Should be:

    Code:
    alert(record.get('company'));

  3. #2
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,585
    Answers
    540
    Vote Rating
    322
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    The get method of a record returns field values based on their name, not an index. e.g.:

    Code:
    record.get('age')
    So just pass it the field name, i.e. the dataIndex, of your first column.

  4. #3
    Sencha User
    Join Date
    Sep 2012
    Posts
    55
    Vote Rating
    0
    bunty is on a distinguished road

      0  

    Default


    its throwing exception: company not defined

    Code:
     ////////////////////////////////////////////////////////////////////////////////////////    // Grid 2
        ////////////////////////////////////////////////////////////////////////////////////////
        var sm = Ext.create('Ext.selection.CheckboxModel',{
        	listeners: {
                select: function(this1, record,  index, eOpts ){            	
                    alert(record.get(company));
                }
        	}
        	
        });
        var grid2 = Ext.create('Ext.grid.Panel', {
            store: getLocalStore(),
            selModel: sm,
            columns: [
                {text: "Company", width: 200, dataIndex: 'company'},
                {text: "Price", renderer: Ext.util.Format.usMoney, dataIndex: 'price'},
                {text: "Change", dataIndex: 'change'},
                {text: "% Change", dataIndex: 'pctChange'},
                {text: "Last Updated", width: 135, renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'lastChange'}
            ],
            columnLines: true,
            width: 600,
            height: 300,
            frame: true,
            title: 'Framed with Checkbox Selection and Horizontal Scrolling',
            iconCls: 'icon-grid',
            renderTo: Ext.getBody()
        });

  5. #4
    Sencha User
    Join Date
    Jul 2012
    Location
    France
    Posts
    159
    Answers
    2
    Vote Rating
    3
    Elfayer is on a distinguished road

      0  

    Default


    Try this :
    PHP Code:
    alert(this.getSelectionModel().getSelection()[0].data.company); 
    or (this is the same)
    PHP Code:
    alert(this.getSelectionModel().getSelection()[0].get('company')); 

  6. #5
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,585
    Answers
    540
    Vote Rating
    322
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    Code:
    alert(record.get(company));
    Should be:

    Code:
    alert(record.get('company'));

Thread Participants: 2

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