0

Updating metadata display

I would like to update my metadata display to show the title of the photo my grid is focused on but I cannot seem to get it correctly. For starters, I just want to know what the grid cell index I am focused on. Here's what I have so far.

Please let me know what I am missing and where I should be putting the update call to my metadata display. Thanks.

CODE
	
createView: function() {
this.controls.backbutton = new KONtx.control.BackButton({
}).appendTo(this);

this.controls.grid = new KONtx.control.Grid(
{
columns :2,
rows:3,
cellCreator: this._cellCreator,
cellUpdater: this._cellUpdater,
styles:
{
vOffset: this.controls.backbutton.height,
width: Theme.viewSpecs.SIDE_BAR.width,
height: Theme.viewSpecs.SIDE_BAR.height - 25 - 20 - 60,
bgcolor:"#F0F0F0"
},//style
events: {}
}
).appendTo(this); //grid

this.controls.pageindicator = new KONtx.control.PageIndicator({
guid: "videolist_main_pageindicator",
styles:
{
vOffset: this.controls.backbutton.height + this.controls.grid.height,
height: 20,
},
focus: true,
threshold: 0,
carousel: false,
}).appendTo(this);

this.controls.metadata = new KONtx.control.MetadataDisplay({
id: "video_metadata",
styles: {
vOffset: this.controls.grid.height + this.controls.backbutton.height + this.controls.pageindicator.height,
width: Theme.viewSpecs.SIDE_BAR.width,
height: 10,
bgcolor: "red",
label: "Bensan",
},
}).appendTo(this);

this.controls.grid.attachAccessories( this.controls.pageindicator, this.controls.metadata );
},

by
1 Reply
  • QUOTE (krmacode @ Feb 25 2011, 08:33 AM) <{POST_SNAPBACK}>
    I would like to update my metadata display to show the title of the photo my grid is focused on but I cannot seem to get it correctly. For starters, I just want to know what the grid cell index I am focused on. Here's what I have so far.

    Please let me know what I am missing and where I should be putting the update call to my metadata display. Thanks.

    CODE
    	
    createView: function() {
    this.controls.backbutton = new KONtx.control.BackButton({
    }).appendTo(this);

    this.controls.grid = new KONtx.control.Grid(
    {
    columns :2,
    rows:3,
    cellCreator: this._cellCreator,
    cellUpdater: this._cellUpdater,
    styles:
    {
    vOffset: this.controls.backbutton.height,
    width: Theme.viewSpecs.SIDE_BAR.width,
    height: Theme.viewSpecs.SIDE_BAR.height - 25 - 20 - 60,
    bgcolor:"#F0F0F0"
    },//style
    events: {}
    }
    ).appendTo(this); //grid

    this.controls.pageindicator = new KONtx.control.PageIndicator({
    guid: "videolist_main_pageindicator",
    styles:
    {
    vOffset: this.controls.backbutton.height + this.controls.grid.height,
    height: 20,
    },
    focus: true,
    threshold: 0,
    carousel: false,
    }).appendTo(this);

    this.controls.metadata = new KONtx.control.MetadataDisplay({
    id: "video_metadata",
    styles: {
    vOffset: this.controls.grid.height + this.controls.backbutton.height + this.controls.pageindicator.height,
    width: Theme.viewSpecs.SIDE_BAR.width,
    height: 10,
    bgcolor: "red",
    label: "Bensan",
    },
    }).appendTo(this);

    this.controls.grid.attachAccessories( this.controls.pageindicator, this.controls.metadata );
    },


    The solution is just to make sure that

    1. You have attached a source to the metadataDisplay
    2. your dataitem has the key 'label' or 'text' in it


    Sigh. That was way too easy.
    0

Recent Posts

in Getting Started / Beginners - Yahoo! TV Widgets