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
jeswinsimon
Posts: 63
Registered: ‎11-12-2012
My Device: BB10 DevAlpha
My Carrier: Airtel
Accepted Solution

How to hide headers in list?

[ Edited ]

I'm trying to create a list populated by sqlite data, but I'm not able to hide a blank header from appearing on top of my list. How do I hide it?

 

Page {
    ListView {
        id: myListView
        dataModel: dataModel
       
        listItemComponents: [
            ListItemComponent {
                type: "item"
                StandardListItem {
                    title: ListItemData.item_name
                }
            }
           ]
    }
    
    attachedObjects: [
        GroupDataModel {
            id: dataModel
        },
        DataSource {
            id: dataSource
            source: "sql/mylist.db"
            query: "select * from items "
            
            onDataLoaded: {
                dataModel.insertList(data);
            }
        }
        ]
     
        onCreationCompleted: {
            dataSource.load();
        }
}

 IMG_00000061.png

Click Accept as Solution if this post that have solved your issue(s)!
Like if you found this post useful..
Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: How to hide headers in list?

You need to turn off grouping in your DataModel, by adding this property:

grouping: ItemGrouping.None

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Developer
jeswinsimon
Posts: 63
Registered: ‎11-12-2012
My Device: BB10 DevAlpha
My Carrier: Airtel

Re: How to hide headers in list?

Thanx :smileyhappy:
Click Accept as Solution if this post that have solved your issue(s)!
Like if you found this post useful..
Please use plain text.
Developer
ankursahu19
Posts: 63
Registered: ‎03-20-2013
My Device: Z10(Red Limited Edition)
My Carrier: MY COMPANY

Re: How to hide headers in list?

try this

listItemComponents: [

 ListItemComponent {
                    type: "header"
                    Header {                        
                    visible: false                       
                    }
                },

ListItemComponent {

type: "item"

StandardListItem {

title: ListItemData.item_name

}

]

Please use plain text.