PDA

View Full Version : config property sample can't work



mambamaestro
6 Dec 2011, 7:49 PM
Hi, i'm new in ext js, i tried to execute config property sample in :
http://docs.sencha.com/ext-js/4-0/#!/guide/class_system
t (http://docs.sencha.com/ext-js/4-0/#!/guide/class_system)hat is

Ext.define('My.own.Window', {
/** @readonly */ isWindow: true, config: { title: 'Title Here', bottomBar: { enabled: true, height: 50, resizable: false } }, constructor: function(config) { this.initConfig(config); return this; }, applyTitle: function(title) { if (!Ext.isString(title) || title.length === 0) { alert('Error: Title must be a valid non-empty string'); } else { return title; } }, applyBottomBar: function(bottomBar) { if (bottomBar && bottomBar.enabled) { if (!this.bottomBar) { return Ext.create('My.own.WindowBottomBar', bottomBar); } else { this.bottomBar.setConfig(bottomBar); } } } });
var myWindow = Ext.create('My.own.Window', {
title: 'Hello World', bottomBar: { height: 60 }});alert(myWindow.getTitle()); // alerts "Hello World"myWindow.setTitle('Something New');alert(myWindow.getTitle()); // alerts "Something New"myWindow.setTitle(null); // alerts "Error: Title must be a valid non-empty string"myWindow.setBottomBar({ height: 100 }); // Bottom bar's height is changed to 100

that raised an error (in chrome, i use xampp):

GET http://localhost/test/My/own/WindowBottomBar.js?_dc=1323228257534 404 (Not Found)


Uncaught TypeError: object is not a function


can we fix this? how and why?

thanks,

ali, from indonesia

mitchellsimoens
9 Dec 2011, 9:13 AM
We didn't have enough time to get the config system working 100% in order to get Ext JS 4 out.

mitchellsimoens
9 Dec 2011, 9:13 AM
Please post in the appropriate forum, I have moved this to the Ext JS 4 Q&A forum.