开发者

Decorating item renderers in custom list components

开发者 https://www.devze.com 2023-01-30 05:21 出处:网络
Has anyone had success creating a custom list component which accepts a user defined item renderer, but decorates it with another class t开发者_开发技巧o augment its behavior?

Has anyone had success creating a custom list component which accepts a user defined item renderer, but decorates it with another class t开发者_开发技巧o augment its behavior?

Examples of why this might be useful include:

  • catching and stopping the propagation of events or dispatching new events in place of others
  • incorporating behavior in the renderer to interface with other packages used by the custom component
  • adding expand and collapse buttons for resizing the internal renderer, etc

The idea here is to not require changing the users renderer to work with this component, so keep that in mind.


Yep, I did this with the Flextras DataSorter. The DataSorter is a customized list that acts like a Netflix Movie Queue. The user's itemRenderer contains their stuff, but our wrapper adds in the number input field, the move up button, the move down button, and the other button controls.

It is pretty much a nightmare that required a lot of heavy customization of the Flex List class.

Since you're question is a "Yes" or "No" question, I feel I've answered it. What else did you want to know?

0

精彩评论

暂无评论...
验证码 换一张
取 消