-
23 Jan 2013 3:40 AM #1
Answered: setOnItemDisclosure() will not hide after already being fired
Answered: setOnItemDisclosure() will not hide after already being fired
I'm having a problem with a list whose setOnItemDisclosure method does not work properly.
If the disclosure is set to false initially and I set it to true via .setOnItemDisclosure(true), the disclosure icons show, but if I do setOnItemDisclosure(false) after, they do not hide. The same happens in both my code and when I try it in the console.
I have a work around by doing:
But I want to avoid doing this as it's not very 'clean'. Has anyone else encountered this issue with lists?Code:Ext.DomQuery.select('.picture-list .x-list-item .x-list-disclosure')[0].style['display'] = 'none'
I'm using Sencha 2.1
-
Best Answer Posted by A.Tyshchyk
List hasn't such functionality. You could add it.
Code:updateOnItemDisclosure: function(newConfig, oldConfig) { if (oldConfig == null) { return; } var items = this.listItems; for (var i = 0, ln = items.length; i < ln; i++) { var dItem = items[i].getDisclosure(); newConfig === false ? dItem.hide() : dItem.show(); } }
-
23 Jan 2013 4:43 AM #2
List hasn't such functionality. You could add it.
Code:updateOnItemDisclosure: function(newConfig, oldConfig) { if (oldConfig == null) { return; } var items = this.listItems; for (var i = 0, ln = items.length; i < ln; i++) { var dItem = items[i].getDisclosure(); newConfig === false ? dItem.hide() : dItem.show(); } }
-
23 Jan 2013 5:11 AM #3
I get what you are doing in the code but can't seem to work out where the oldConfig and newConfig will come from? Is this supposed to be added as an override to the list class?
Cheers.
-
23 Jan 2013 5:22 AM #4
update- and apply- methods is automatically generated and will call, if you call set- method.
You may add this code to extended class from List.
-
23 Jan 2013 5:39 AM #5


Reply With Quote