-
29 Nov 2012 2:59 AM #1
Answered: Make some items of Nestedlist unclickable
Answered: Make some items of Nestedlist unclickable
I have a nestedlist filled with items. I want to make some of the items unclickable. Is there a variable to unset or some kind of flag I can use?
UPDATE. Under items I mean the data loaded from Store object.Last edited by tracker2k; 29 Nov 2012 at 3:26 AM. Reason: update
-
Best Answer Posted by tracker2k
I have found another solution. I have just override basic function onItemTap of my nestedlist and base my function on code from basic function. Than I have implemented some needed logic and that's it.
Code:onItemTap: function(list, index, target, record, e) { var me = this, store = list.getStore(), node = store.getAt(index); var is_separator = record.get('separator'); me.fireEvent('itemtap', this, list, index, target, record, e); if (node.isLeaf()) { if (! is_separator) { me.fireEvent('leafitemtap', this, list, index, target, record, e); me.goToLeaf(node); } } else { if (! is_separator) { this.goToNode(node); } } }
-
29 Nov 2012 3:20 AM #2
What sort of items? Off the top of my head, you could query the components and then apply .setDisabled(true) on them.
-
29 Nov 2012 3:24 AM #3
-
29 Nov 2012 3:31 AM #4
I'm not sure if it is possible to do it via a tpl applied in the list. But you could run some code after loading the list which searches your store for the indexes of the records that need to be disabled, then using that index, access that item within the list component to apply the .setDisabled(true)
-
30 Nov 2012 3:49 AM #5
I have found another solution. I have just override basic function onItemTap of my nestedlist and base my function on code from basic function. Than I have implemented some needed logic and that's it.
Code:onItemTap: function(list, index, target, record, e) { var me = this, store = list.getStore(), node = store.getAt(index); var is_separator = record.get('separator'); me.fireEvent('itemtap', this, list, index, target, record, e); if (node.isLeaf()) { if (! is_separator) { me.fireEvent('leafitemtap', this, list, index, target, record, e); me.goToLeaf(node); } } else { if (! is_separator) { this.goToNode(node); } } }


Reply With Quote