-
5 Aug 2010 7:55 PM #1
Edit List items
Edit List items
Hi,
Is it possible to have 'Edit' button which can allow editing (removing) items from a list? (like the native List conponent in XCode.
Any pointers on how to achieve this?
I was thinking of using some kind of DOM manipulation to add DIV elements to list component and performing some actions but not sure if anyone has already done it.
-
6 Aug 2010 1:28 AM #2
This is how I got it done to remove rows from a list. I added a class call deletegifts to the delete button. So when the itemtap event occurs I can know where the user clicked. Well I guess the code will explain everything for u.Code:{ xtype: 'list', store: giftStore, tpl: '<tpl for="."><div class="gifts {cls}">'+ '<span class="listDelete deleteGifts"> </span>'+ '<span class="listProduct listPayType">{giftNumber}</span>'+ '<span class="listDelete listPayAmount">{price}</span>'+ '</div></tpl>', itemSelector: 'div.gifts', singleSelect: true, cls:'productList', scroll:false, listeners: { "itemtap": function(dataview,index,element,evt) { eventClassname = evt.target.className; titleClassname = element.className; if((eventClassname.search('deleteGifts')!= -1) &&(titleClassname.search('prodListHeader') == -1)) { selectedRecord = dataview.store.getAt(index); dataview.store.remove(selectedRecord); } } } }
-
6 Aug 2010 3:48 AM #3
cool, sounds interesting.
I am going to try it later today.
-
6 Aug 2010 6:48 PM #4
...
Last edited by Considerate; 6 Aug 2010 at 6:50 PM. Reason: I thought I was watching another thread -.-
Similar Threads
-
Combobox inner list not aligning list items propertly ?
By ritesh.kapse in forum Ext 2.x: Help & DiscussionReplies: 13Last Post: 29 Oct 2010, 5:29 AM -
Editable list items?
By ssdesign in forum Sencha Touch 1.x: DiscussionReplies: 1Last Post: 7 Jul 2010, 9:18 AM -
How to get list of items in accordion panel
By Max Carey in forum Ext 2.x: Help & DiscussionReplies: 2Last Post: 11 Jun 2008, 9:50 AM -
Form items list
By yuiman in forum Ext 2.x: Help & DiscussionReplies: 2Last Post: 31 May 2008, 6:59 PM -
Get all list items?
By doubleforte in forum Ext 2.x: Help & DiscussionReplies: 2Last Post: 25 Oct 2007, 8:56 AM


Reply With Quote