0

problem of KONtx.control.MetadataDisplay

Hi everyone,

Is there any method similar to KONtx.control.MetadataDisplay, which can be used in grid displays to show a image or some text related to each cell when an individual cell is selected?

Thanks

by
5 Replies
  • Just add an onFocus event to the cell and hook that to the display that you want.
    0
  • QUOTE (WidgetRealm @ Nov 30 2010, 11:28 AM) <{POST_SNAPBACK}>
    Just add an onFocus event to the cell and hook that to the display that you want.


    But If I want to focus on a cell and show the pictures or text in another container, can it be realized?

    I've tried many times but doesn't work

    Can you just give me some exemples?
    0
  • you need to pass a reference to the object you are trying to update with the information for the cell.

    CODE
    createView: function() {
    this.mydisplay = new KONtx.elements.Container();
    //put whatever you want in the container.
    // I am assuming a function called setTitle
    this.mygridy = new KONtx.elements.Grid();
    }

    updateView: fucntion() {
    this.mydataset = [{title:"my item 1",thedisplay:this.mydisplay},{title:"my item 2",thedisplay:this.mydisplay}]
    this.mygrid.changeDataset(this.mydataset, this.mydataset.length < 1);
    }

    _cellCreator: function() {
    var cell = new KONtx.control.GridCell({
    events: {
    onFocus: function () { this.info.thedisplay.setTitle(this.info.title); }, //Set the title on focus
    onBlur: function () {this.info.thedisplay.setTitle(""); }, //Clear the title on removed focus
    }
    return cell;
    },

    _cellUpdater: function(cell, dataitem) {
    cell.info = dataitem;
    },
    0
  • Small error int the above....

    CODE
    createView: function() {
    this.mydisplay = new KONtx.elements.Container();
    //put whatever you want in the container.
    // I am assuming a function called setTitle
    this.mygrid = new KONtx.elements.Grid();
    }

    updateView: fucntion() {
    this.mydataset = [{title:"my item 1",thedisplay:this.mydisplay},{title:"my item 2",thedisplay:this.mydisplay}]
    this.mygrid.changeDataset(this.mydataset, this.mydataset.length < 1);
    }

    _cellCreator: function() {
    var cell = new KONtx.control.GridCell({
    events: {
    onFocus: function () { this.info.thedisplay.setTitle(this.info.title); }, //Set the title on focus
    onBlur: function () {this.info.thedisplay.setTitle(""); }, //Clear the title on removed focus
    }
    return cell;
    },

    _cellUpdater: function(cell, dataitem) {
    cell.info = dataitem;
    },



    I hate not being able to edit your posts.... :a
    0
  • QUOTE (WidgetRealm @ Dec 1 2010, 08:43 AM) <{POST_SNAPBACK}>
    CODE
        
    this.mygridy = new KONtx.elements.Grid();


    haha, I've found the small error you said. :D Anyway,thanks a lot , I've got a idea now
    0

Recent Posts

in Getting Started / Beginners - Yahoo! TV Widgets