1. #1
    Sencha User
    Join Date
    Sep 2011
    Posts
    13
    Vote Rating
    0
    gwinning is on a distinguished road

      0  

    Default Unanswered: selectFirstRow() failing - NOT the FAQ

    Unanswered: selectFirstRow() failing - NOT the FAQ


    I created a quick "proof of concept" application using the demo designer. It populates a grid from JSON that comes from a dynamic web page generated by another app. Everything seems to work great EXCEPT for the selectFirstRow() method that I'm trying to call last. The error is "object doesn't support property or method 'selectFirstRow' " . I've dug through hours of forum entries, FAQ, and docs with no luck. The code from the generated .js file edited in order to add the event handlers is below.
    Ext.define('OrionSales.view.vpOrionSales', {
    extend: 'OrionSales.view.ui.vpOrionSales',

    initComponent: function() {
    var me = this;
    me.callParent(arguments);

    Ext.getCmp('btnCustName').on('click',
    this.onbtnCustNameClick, this);
    Ext.getCmp('custGrid').getSelectionModel().on('select',
    this.onGridRowSelect, this);
    // theGrid.getStore().on('load', this.onStoreLoad, this);
    },
    onbtnCustNameClick: function() {
    var cs = Ext.StoreMgr.get("CustStore");
    var myProxy = cs.getProxy();
    var strSearch = Ext.getCmp("txtSearchName").getValue();
    myProxy.url = "/scripts/codexdv1.wsc/JSONFindCustomer.p?Mode=CustBegins&FilterValue=" + strSearch;
    cs.load();
    var sm = this.down('#custGrid').getSelectionModel();
    sm.selectFirstRow();
    },
    onGridRowSelect: function(grid, record) {
    this.down('#txtCustomer').setValue(record.data.custName);
    }
    });


    I also tried it in the "onStoreLoad" event for fun, but I ended up with the same error.

    Thanks,
    Gerry

  2. #2
    Ext JS Premium Member twaindev's Avatar
    Join Date
    Sep 2009
    Posts
    223
    Answers
    15
    Vote Rating
    3
    twaindev is on a distinguished road

      0  

    Default


    Is this 3.x? This is a 4.x section. In 4.x the selection models don't have a selectFirstRow() method.

  3. #3
    Sencha User
    Join Date
    Sep 2011
    Posts
    13
    Vote Rating
    0
    gwinning is on a distinguished road

      0  

    Default


    Well, that is annoying that it is not a feature in 4.x considering the zillion examples I poured through. To actually answer the question myself (at least what I am guessing is the answer), I moved the attempt to the onStoreLoad and used sm.Select(0) to select the first record. It appears to work, but I'd have been more comfortable if I read it from a sanctioned example than using guesswork and the Sencha Docs minimal reference page.
    Last edited by gwinning; 6 Oct 2011 at 5:21 AM. Reason: Note that this replay actually answers the question of "how to" instead of just saying "don't do that"

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar