Results 1 to 2 of 2

Thread: Load List with a selected Item

  1. #1

    Default Load List with a selected Item

    Hi,

    I want to load a list with the first item selected, and for that, i should fire the itemtap event of my list, so i tried
    Code:
                        this.fireEvent(listeEtab,0,listeEtab.store.getAt(0),'itemtap')
    , but it's not working

    Can someone explain to me the meaning of each parameter of itemtap event,or maybe an example ?

    itemtap : ( Ext.DataView this, Number index, Ext.Element item, Ext.EventObject e )

    Thx

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379
    Answers
    3997

    Default

    Firing an event is not the proper way to select an item. Use the select method on the List:

    Code:
    list.select(1);
    select takes the following arguments:

    1. Record/Array of Records/Index
    2. True/False to keep existing selections (optional)
    3. True?False to suppress the select event (optional)
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

Posting Permissions

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