Results 1 to 2 of 2

Thread: Dynamically add an item to a list

  1. #1
    Sencha User
    Join Date
    Jun 2010
    Vote Rating

    Default Dynamically add an item to a list

    This works:
    Ext.setup({onReady: function () {
    var e = new Ext.Panel({ fullscreen: true, items: [{ html: 'a' }, { html: 'b'}] });
    e.add({ html: 'c' });
    Change it to an Ext.List and it blows up in the DataView's refresh method on the following line because '' is undefined:
    if ( < 1 && (!this.deferEmptyText || this.hasSkippedEmptyText)) {

    What's the appropriate way to dynamically add items to a list?

  2. #2
    Sencha User
    Join Date
    Mar 2007
    Haarlem, Netherlands
    Vote Rating


    List is not something that you can add components to. A list is always backed by a store. You can check the source code for our list example to see how to use it.

    Once you have your list with store setup you can easily add items by just adding a new record to the store.

Similar Threads

  1. Add tab item dynamically
    By wwwjsx in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 24 Oct 2009, 1:18 AM
  2. add item not in combobox list
    By iceblast_01 in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 4 Dec 2008, 8:21 PM
  3. how to add componets dynamically to items list of Accordian
    By rao in forum Ext 2.x: Help & Discussion
    Replies: 5
    Last Post: 29 Aug 2008, 9:36 PM
  4. Add toolbar item dynamically?
    By TopKatz in forum Ext 1.x: Help & Discussion
    Replies: 6
    Last Post: 3 Apr 2007, 12:04 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