0

Load View

Hi, I m currently having trouble loading a view. I want to link from main.js to watchavideo.js :


Under main.js
CODE
   
this.controls.watchVideo = new KONtx.control.TextButton({

label: 'Watch A Video',

styles: {

width: 294,

height: 40,

vOffset: this.controls.items1.outerHeight + 3

}, //Style information for the Button stored in our 960x540.js file

events: {

onSelect:function(event){

KONtx.application.loadView('view-video');

}

}

}).appendTo(this);



Under watchavideo.js
CODE
   
var WatchAVideo = new KONtx.Class({

ClassName: 'WatchAVideo',



Extends: KONtx.system.SidebarView,



Under init.js
CODE
include("Javascript/views/main.js");

include("Javascript/views/watchavideo.js");




KONtx.application.init({

views: [

{ id: 'view-Main', viewClass: MainView },

{ id: 'view-About', viewClass: AboutView },

{ id: 'snippet-main', viewClass: Snippet },
{ id: 'view-video', viewClass: WatchAVideo },



],

defaultViewId: 'view-Main', //Linking our main.js ("MainView") as the default view for the Widget

settingsViewId: 'view-About', //Linking our aboutview.js ("AboutView") as the default view for the Widget

});


I am getting an error saying "Can't get a valid config"
Is there anything wrong with these codes? Or am I missing something?
Thanks in advance!

by
2 Replies
  • QUOTE (Wei loon Ang @ Mar 28 2011, 01:23 AM) <{POST_SNAPBACK}>
    I am getting an error saying "Can't get a valid config"
    Is there anything wrong with these codes? Or am I missing something?
    Thanks in advance!

    That error is usually caused because of a typo. JavaScript is case-sensitive and referring to myClass as MyClass could cause this error. Also, video can only be played in a fullscreen view.
    0
  • You are right ben, I have found an syntax error. Thanks a lot.
    0

Recent Posts

in Getting Started / Beginners - Yahoo! TV Widgets