Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Robdob
Posts: 223
Registered: ‎01-31-2013

Is it possible to embed my own code every X item of a ListView->ListItemComponent?

Hi,

 

I would like to embed my own code segment every x item being displayed within my ListView->ListItemComponent.  Can someone tell me what tis he best way to accomplish this?,  am I best to just manipulate the data within my ArrayDataModel at the time of creation.

 

here is a code fragment..

 

ListView{

 id: searchListView

listItemComponents: [

ListItemComponent{

 

type: "item"type: ""

SearchResultsListItem{

title: ListItemData.Title

]

 

......



GeoYeo - Free Local classifieds - Built for Blackberry 10, if you like it please Rate It and Share it!
Please use plain text.
Developer
simon_hain
Posts: 15,558
Registered: ‎07-29-2008
My Carrier: O2 Germany

Re: Is it possible to embed my own code every X item of a ListView->ListItemComponent?

manipulating the data would be one way.
another idea would be to use the itemType function:
function itemType(data, indexPath) {
return "item";
}

as you get the indexPath you could return an itemtype based on the path.
see https://developer.blackberry.com/native/reference/cascades/bb__cascades__datamodel.html
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.