-
15 Aug 2012 12:55 PM #1
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:
But, not add item for add map icon, it is overwrite by ajax data.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__'}); }
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,
-
16 Aug 2012 2:53 PM #2Sencha - Support Team
- Join Date
- Jul 2010
- Location
- Houston, Tx
- Posts
- 7,185
- Vote Rating
- 194
- Answers
- 433
Can you insert a new item on the store load listener?
Scott.
-
17 Aug 2012 3:31 PM #3
Scott, thanks!
I could add it.
And, is there any way to make it item always being top if they items sorted?
-
17 Aug 2012 5:05 PM #4Sencha - Support Team
- Join Date
- Jul 2010
- Location
- Houston, Tx
- Posts
- 7,185
- Vote Rating
- 194
- Answers
- 433
Since it is on the load event, it will insert(0,..) after sort reloads the record.
Scott.


Reply With Quote