Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Apress committed Oct 17, 2016
0 parents commit 1b6d4bf
Show file tree
Hide file tree
Showing 584 changed files with 4,221 additions and 0 deletions.
Binary file added 9781430260738.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions 9781430260738/Chapter_01/arguments.htm
@@ -0,0 +1,16 @@
<html>
<head>
<script>
function add(){
var sum = 0;
for(var i=0;i<arguments.length;i++){
sum += arguments[i];
}
console.log(sum);
}
add(1,2,3); //Prints 5
add(10,20,30,40,50); //Prints 150
add(100,12); //Prints 112
</script>
</head>
</html>
16 changes: 16 additions & 0 deletions 9781430260738/Chapter_01/classes.htm
@@ -0,0 +1,16 @@
<html>
<head>
<script>
function Person(theName,theAge){
this.name = theName; //public variable
this.age = theAge;
this.eat = function(){
console.log(this.name + " is eating");
}
}
var p1 = new Person("Sam",23);
p1.eat(); //Prints Sam is eating
console.log(p1.age); // Prints 23
</script>
</head>
</html>
15 changes: 15 additions & 0 deletions 9781430260738/Chapter_01/functions.htm
@@ -0,0 +1,15 @@
<html>
<head>
<script>
eat();
function eat(){
console.log("Eating");
}
function work(arg){
arg();
}
work(eat);
work(function(){console.log("Coding");});
</script>
</head>
</html>
17 changes: 17 additions & 0 deletions 9781430260738/Chapter_01/json.htm
@@ -0,0 +1,17 @@
<html>
<head>
<script>
var myBook = {
title : "Practical Ext JS4",
author:"Prabhu Sunderaraman",
publisher : "APress",
price : 49.99,
formats : ["e-book","paperback"],
order : function(){
console.log("Ordering " + this.title + " in Amazon");
}
};
myBook.order();
</script>
</head>
</html>
20 changes: 20 additions & 0 deletions 9781430260738/Chapter_02/HelloWorld-Button.htm
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<link href="../extjs/resources/css/ext-all.css" rel="stylesheet" type="text/css" />
<script src="../extjs/ext-all.js" type="text/javascript"></script>
<script>
Ext.onReady(function () {
Ext.create("Ext.Button",{
text : "Hello World",
handler : function(){
Ext.Msg.alert("You clicked the hello world button");
},
renderTo : Ext.getBody()
});
});
</script>
</head>
<body>
</body>
</html>
17 changes: 17 additions & 0 deletions 9781430260738/Chapter_02/HelloWorld-Label.htm
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<link href="../extjs/resources/css/ext-all.css" rel="stylesheet" type="text/css" />
<script src="../extjs/ext-all.js" type="text/javascript"></script>
<script>
Ext.onReady(function () {
Ext.create("Ext.form.Label", {
text: "Hello World",
renderTo: Ext.getBody()
});
});
</script>
</head>
<body>
</body>
</html>
28 changes: 28 additions & 0 deletions 9781430260738/Chapter_02/HelloWorld-Panel.htm
@@ -0,0 +1,28 @@
<!DOCTYPE html>
<html>
<head>
<link href="../extjs/resources/css/ext-all.css" rel="stylesheet" type="text/css" />
<script src="../extjs/ext-all.js" type="text/javascript"></script>
<script>
Ext.onReady(function () {
Ext.create("Ext.Panel",{
title : "Hello World Panel",
items : [
Ext.create("Ext.form.field.Text",{
fieldLabel : "Name"
}),
Ext.create("Ext.Button",{
text : "Click",
handler : function(){
Ext.Msg.alert(Ext.getCmp("nametext").getValue());
}
})
],
renderTo : Ext.getBody()
});
});
</script>
</head>
<body>
</body>
</html>
14 changes: 14 additions & 0 deletions 9781430260738/Chapter_02/HelloWorld.htm
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<link href="../extjs/resources/css/ext-all.css" rel="stylesheet" type="text/css" />
<script src="../extjs/ext-all.js" type="text/javascript"></script>
<script>
Ext.onReady(function () {
Ext.Msg.alert("Hello World","All set!!!");
});
</script>
</head>
<body>
</body>
</html>
13 changes: 13 additions & 0 deletions 9781430260738/Chapter_03/Classes.htm
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<script src="../extjs/ext-all.js" type="text/javascript"></script>
<script>
Ext.define("DuraSoft.tech.extjs4.Book",{});
var book1 = new DuraSoft.tech.extjs4.Book();
var book2 = Ext.create("DuraSoft.tech.extjs4.Book");
</script>
</head>
<body>
</body>
</html>
34 changes: 34 additions & 0 deletions 9781430260738/Chapter_03/Config.htm
@@ -0,0 +1,34 @@
<!DOCTYPE html>
<html>
<head>
<script src="../extjs/ext-all.js" type="text/javascript"></script>
<script>
Ext.define("DuraSoft.tech.extjs4.Book",{
config : {
title : "",
price : -1,
authors: []
},
constructor : function(cfg){
this.initConfig(cfg);
},
setPrice: function (priceVal) {
if (priceVal < 5)
console.log("Invalid value for price " + priceVal);
else
this.price = priceVal;
}
});
var xml = Ext.create("DuraSoft.tech.extjs4.Book",{
title : "XML for beginners",
authors : ["Sam","Kim"]
});
xml.setPrice(3);
console.log(xml.getPrice());
xml.setPrice(30);
console.log(xml.getPrice());
</script>
</head>
<body>
</body>
</html>
15 changes: 15 additions & 0 deletions 9781430260738/Chapter_03/Constructors.htm
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<script src="../extjs/ext-all.js" type="text/javascript"></script>
<script>
Ext.define("DuraSoft.tech.extjs4.Book",{
constructor : function(){
console.log("Book created");
}
});
</script>
</head>
<body>
</body>
</html>
15 changes: 15 additions & 0 deletions 9781430260738/Chapter_03/Dependencies.htm
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<link href="../extjs/resources/css/ext-all.css" rel="stylesheet" type="text/css" />
<script src="../extjs/ext-all.js"></script>
<script>
Ext.define("MyPanel",{
requires : ["Ext.button.Button"],
extend : "Ext.panel.Panel"
});
</script>
</head>
<body>
</body>
</html>
24 changes: 24 additions & 0 deletions 9781430260738/Chapter_03/Ext.Class.htm
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html>
<head>
<script src="../extjs/ext-all.js"></script>
<script>
var Book = new Ext.Class({
config: {
title: "",
price: 5
},
constructor: function (cfg) {
this.initConfig(cfg);
},
read: function () {
console.log("Reading " + this.getTitle());
}
});
var ajax = Ext.create("Book", { title: "AJAX",price:12.00 });
ajax.read();
</script>
</head>
<body>
</body>
</html>
37 changes: 37 additions & 0 deletions 9781430260738/Chapter_03/Inheritance.htm
@@ -0,0 +1,37 @@
<!DOCTYPE html>
<html>
<head>
<script src="../extjs/ext-all.js"></script>
<script>
Ext.define("Employee",{
config : {
employeeid : "",
name : "",
salary : 0
},
constructor : function(cfg){
this.initConfig(cfg);
},
work : function(){
console.log(this.getName() + " is working");
}
});
Ext.define("Manager",{
extend : "Employee",
config : {
level : 1
},
work : function(){
this.callParent();
console.log(this.getName() + " is in a meeting");
}
});
var mgr = Ext.create("Manager",{
employeeid:"DS123", name: "Sam", level: 4
});
mgr.work();
</script>
</head>
<body>
</body>
</html>
25 changes: 25 additions & 0 deletions 9781430260738/Chapter_03/Methods.htm
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<script src="extjs/ext-all.js" type="text/javascript"></script>
<script>
Ext.define("DuraSoft.tech.extjs4.Book",{
config : {
title : "", price: 0
},
constructor : function(cfg){
this.initConfig(cfg);
},
read: function(){
console.log("Reading " + this.getTitle());
}
});
var xml = Ext.create("DuraSoft.tech.extjs4.Book",{
title : "XML", price:12.00
});
xml.read(); //Prints Reading XML
</script>
</head>
<body>
</body>
</html>
27 changes: 27 additions & 0 deletions 9781430260738/Chapter_03/Mixins.htm
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html>
<head>
<script src="../extjs/ext-all.js"></script>
<script>
Ext.define("Aquatic",{
swim : function(){
console.log("Swimming");
}
});
Ext.define("Terrestrial",{
walk : function(){
console.log("Walking");
}
});
Ext.define("Reptile",{
mixins : ["Aquatic","Terrestrial"]
});

var reptile = Ext.create("Reptile");
reptile.swim();
reptile.walk();
</script>
</head>
<body>
</body>
</html>
21 changes: 21 additions & 0 deletions 9781430260738/Chapter_03/Properties.htm
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<head>
<script src="../extjs/ext-all.js" type="text/javascript"></script>
<script>
Ext.define("DuraSoft.tech.extjs4.Book",{
title : "",
price : -1,
constructor : function(title,price){
this.title = title;
this.price = price;
}
});
var xml = Ext.create("DuraSoft.tech.extjs4.Book","XML",12.00);
console.log(xml.title);
console.log(xml.price);
</script>
</head>
<body>
</body>
</html>

0 comments on commit 1b6d4bf

Please sign in to comment.