caleem@gmail.com
10 Oct 2012, 5:01 PM
hi,
I have created following class for Sencha, but it doesn't show the alert message.
Can someone tell me whats wrong with the code?
Also 1. do i need tp copy Person class under a separate file under folder structure My\sample ??
2. if there is any error how can I check that, I am using trial version and google chrome.
comments and suggestion are appropriated, thank you...
here is the code below.
Ext.application({
name: 'HelloExt',
launch: function(){
Ext.define('My.sample.Person',{
name: 'John';
constructor: function (name){
if (name){
this.name = name;
}
}
eat: function(foodtype){
alert(this.name + ' is eating ' + foodtype );
}
});
var k = Ext.create('My.sample.Person', 'JJ');
k.eat('fishhh');
}
});
I have created following class for Sencha, but it doesn't show the alert message.
Can someone tell me whats wrong with the code?
Also 1. do i need tp copy Person class under a separate file under folder structure My\sample ??
2. if there is any error how can I check that, I am using trial version and google chrome.
comments and suggestion are appropriated, thank you...
here is the code below.
Ext.application({
name: 'HelloExt',
launch: function(){
Ext.define('My.sample.Person',{
name: 'John';
constructor: function (name){
if (name){
this.name = name;
}
}
eat: function(foodtype){
alert(this.name + ' is eating ' + foodtype );
}
});
var k = Ext.create('My.sample.Person', 'JJ');
k.eat('fishhh');
}
});