1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    8
    Vote Rating
    0
    kohhy is on a distinguished road

      0  

    Default Unanswered: Is there any way to show "Add item" member on icon data view?

    Unanswered: Is there any way to show "Add item" member on icon data view?


    Hello,

    I'm making a map viewer based on this example, and I want to show 'Add map' icon in the top of data view.

    This is sample image:
    addmap_image.png

    But, there are two problems:

    1:
    I try to do this by code below:

    Code:
        initComponent: function() {
            this.store = Ext.create('Ext.data.Store', {
                autoLoad: true,
                fields: ['mapName', 'mapID', 'meta'],
                proxy: {
                    type: 'ajax',
                    url : '/maplist.json',
                    reader: {
                        type: 'json',
                        root: ''
                    }
                }
            });
            
            this.callParent(arguments);
            this.store.sort();
            this.store.insert(0,{mapName:'Add Map ',mapID:'__AddNewMap__'});
        }
    But, not add item for add map icon, it is overwrite by ajax data.
    How can I add extra item in top of data items?

    2:
    If I add "add map" item not as extra item but as the item included in data, it works.
    But another problem is, if I make a sort, "add map" item is also sorted.

    Is there any way to avoid sorting for some items?


    Thanks,

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,075
    Answers
    674
    Vote Rating
    467
    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


    Can you insert a new item on the store load listener?

    Scott.

  3. #3
    Sencha User
    Join Date
    Apr 2012
    Posts
    8
    Vote Rating
    0
    kohhy is on a distinguished road

      0  

    Default


    Scott, thanks!

    I could add it.

    And, is there any way to make it item always being top if they items sorted?

  4. #4
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,075
    Answers
    674
    Vote Rating
    467
    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


    Since it is on the load event, it will insert(0,..) after sort reloads the record.

    Scott.

Thread Participants: 1

Tags for this Thread