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
Contributor
lichienmine
Posts: 34
Registered: ‎08-15-2013
My Device: Blackberry 10
My Carrier: XL

Add Footer In GridListView with GroupDataModel Like Music App

hi guys, i need some help. i have making a GridListView with Groupdatamodel Like Music App, but how do i make expand button in the right bottom every group ? here is the code and preview :

 

ListView {
  id:listview
  horizontalAlignment: HorizontalAlignment.Fill
  layout: GridListLayout {
    headerMode: ListHeaderMode.Sticky
    cellAspectRatio: 0.62
  }
  dataModel: dataModel
  listItemComponents: [
    ListItemComponent {
      type: "header"
      Container {
        horizontalAlignment: HorizontalAlignment.Fill
        preferredWidth: 768
        topPadding: 10
        bottomPadding: 20
        leftPadding: 20
        
        Label {  
          id : headerLabel
          text: qsTr(ListItemData)
          textStyle.base: SystemDefaults.TextStyles.TitleText
          textStyle.color: Color.create("#FFFFFF")
          textStyle.fontSize: FontSize.Medium
          horizontalAlignment: HorizontalAlignment.Left
        }
      }
    },
    ListItemComponent {
      type: "item"
      Container {
        id: newreleaseItem
        layoutProperties: StackLayoutProperties {}
        layout: DockLayout {}
                                
        ImageView {
          horizontalAlignment: HorizontalAlignment.Fill
          verticalAlignment: VerticalAlignment.Fill
          preferredWidth: 256
          preferredHeight: 400
          scalingMethod: ScalingMethod.AspectFill
        }
     }
}
] }

 

 

IMG_00001001.png

Please use plain text.
Developer
BBSJdev
Posts: 6,089
Registered: ‎07-05-2012
My Device: Playbook, Z10 LE, Dev Alpha C
My Carrier: Orange

Re: Add Footer In GridListView with GroupDataModel Like Music App

[ Edited ]

This has been asked a few times in the forums.

 

Basically you would overlay a DockLayout Container over the ListView then add the button to the Bottom-Right.

You would then update the ListView's position by 8 (in this case) everytime it's clicked.

 

[Edit] Sorry the third line suggestion is not relevant to you, I thought you were trying to do the same thing as the last person, in your case you would just open another page with a full page ListView.

 

For efficiency sake I would pass the ListView object not create another one.

 

 


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
Contributor
lichienmine
Posts: 34
Registered: ‎08-15-2013
My Device: Blackberry 10
My Carrier: XL

Re: Add Footer In GridListView with GroupDataModel Like Music App

sorry for long respons, but can you tell me how to do that ?

Please use plain text.
Developer
BBSJdev
Posts: 6,089
Registered: ‎07-05-2012
My Device: Playbook, Z10 LE, Dev Alpha C
My Carrier: Orange

Re: Add Footer In GridListView with GroupDataModel Like Music App

[ Edited ]
Container {
    layout: DockLayout { }
	
    ListView {
        id: lv

	[ ... ]

     }

      ImageButton {
          horizontalAlignment: HorizontalAlignment.Right
          verticalAlignment: VerticalAlignment.Bottom
   
          defaultImageSource: "asset:///images/expander_icon.png"
          pressedImageSource: "asset:///images/expander_active.png"
      		
          onClicked: {
              var expage = attachedPage.createObject();
              expage.listviewlink = lv;                    
              nav.push(expage);
          }
     }
}

 


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
Contributor
lichienmine
Posts: 34
Registered: ‎08-15-2013
My Device: Blackberry 10
My Carrier: XL

Re: Add Footer In GridListView with GroupDataModel Like Music App

thanks, but its only show one button per listview, all i want is show button every grouping item in listview

Please use plain text.
Developer
BBSJdev
Posts: 6,089
Registered: ‎07-05-2012
My Device: Playbook, Z10 LE, Dev Alpha C
My Carrier: Orange

Re: Add Footer In GridListView with GroupDataModel Like Music App

Sorry not awake yet.

 

In that case I believe you would have to use indexInSection to determine if it is the last / 8th item depending on your implementation and if it is dynamically add it to that ListItem.

 

 


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.