我不知道以下是否可能。
我确实有一个带有元素的 Sencha 触摸旋转木马。在某些时候,我想删除/销毁旋转木马,但不是旋转木马中的项目。
据我所知,删除和销毁两者也会销毁添加到轮播中的项目。
任何有关解决问题的提示都会很棒。
最佳答案
删除方法接受一个参数以防止删除的项目被破坏。在您的情况下,您可能需要使用 removeAll(false)
.
// save items (not needed, but you probably need to keep a reference for later use)
var items = carousel.getItems();
// empty the carousel before destroying it
carousel.removeAll(false); // destroy set to false
// now you can dispose of the carousel
carousel.destroy();
// then, you'll probably want to add your items to another container...
otherContainer.add(items);
关于extjs - Sencha touch,移除传送带而不破坏元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16978642/