Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Apress
committed
Oct 17, 2016
0 parents
commit 1b6d4bf
Showing
584 changed files
with
4,221 additions
and
0 deletions.
There are no files selected for viewing
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
Oops, something went wrong.