dojo
ethan777
这个作者很懒,什么都没留下…
展开
-
dijit._Container源码
define("dijit/_Container", ["dojo", "dijit"], function(dojo, dijit) { dojo.declare("dijit._Container", null, { // summary: // Mixin for widgets that contain a set of widget children...原创 2012-04-28 22:38:51 · 123 阅读 · 0 评论 -
Dojo的ItemFileReadStore
Dojo.data是一种类似于JDBC的API规范,dojo.data驱动实现了这些规范,并且负责响应那些来自于数据小部件的请求。一般来讲,每个驱动程序负责一种不同的数据提供者格式,例如JSON或者XML。 先大致介绍下数据驱动中的ItemFileReadStore: 这个stroe可以使用HTTP读取json格式的内容,或者从内存中读取js对象,并把所有items都存...原创 2012-03-23 12:16:19 · 125 阅读 · 0 评论 -
dojo中数据类型的判断
前面介绍过,如下的语句是有问题的. var s = new String("abc"); console.log(typeof s == "string"); //false dojo提供了一些函数用来解决类似的问题。 var a = "test"; var b = new String("abc"); console.log(dojo.isString...原创 2012-03-23 13:36:49 · 129 阅读 · 0 评论 -
js匿名函数
前面已经学过了三种定义js函数的方法,回顾一下: //方式1 function fun(x){ console.log(x); } //方式2 var fun = function(x){ console.log(x); } //方式三 var fun1 = new Function("x","console.log('x')"); ...原创 2012-03-23 16:57:14 · 71 阅读 · 0 评论 -
dojo的DataGrid
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> ..原创 2012-03-24 21:08:52 · 135 阅读 · 0 评论 -
dojo的DataGrid2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> ..原创 2012-03-24 22:50:29 · 65 阅读 · 0 评论 -
dojo的DataGrid3
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> ..原创 2012-03-24 23:14:54 · 79 阅读 · 0 评论 -
dojo的DataGrid4
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> ..原创 2012-03-24 23:25:24 · 117 阅读 · 0 评论 -
dojo类定义
在dojo中使用dojo.declare函数来定义类。对于dojo.declare它有三个参数 1.函数名(类名) 这个函数是在全局对象空间创建的,一般情况下,在全局对象作用空间中,创建函数并不是很好,所以可以使用一个由点分开的名字,从而在另一个空间保存新的构造函数。如 dojo.declare("myFunction.Circle",null,{ 这...原创 2012-03-29 19:52:59 · 94 阅读 · 0 评论 -
dojo.hitch
dojo.hitch是一个比较有用的方法,主要是给一个函数提供执行环境。 var theAccumulator = { total: 0, clear: function(){ this.total = 0; }, add:function(x){ this.total += x; }, ge...原创 2012-03-30 12:51:01 · 103 阅读 · 0 评论 -
dojo.from.FilteringSelect
dojo有两个小部件实现了增量搜索,dojo.from.FilteringSelect和dojo.from.ComoBox.他们都是从dojo.data数据源中获取提示数据,并且每一个都使用一个<select>标签来实现界面,所不同的是FilteringSelect使用将选项限制在提示数据的集合内,而ComoBox不会这样做。 <!DOCTYPE html PUB...原创 2012-04-04 22:03:49 · 120 阅读 · 0 评论 -
dijit.form.DateTextBox
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head> <meta原创 2012-04-05 07:53:40 · 223 阅读 · 0 评论 -
dojo克隆对象
js在涉及对象和DOM节点的赋值操作时执行的是潜复制, 我们来看下什么叫潜复制: function foo(){ this.bar = "baz"; } var foo1 = new foo(); var foo2 = foo1; console.log(foo1.bar); //bar console.log(foo2.bar); //bar ...原创 2012-03-22 11:00:09 · 206 阅读 · 0 评论 -
dojo扩展对象原型
Base的extend方法和mixin方法很类似,它们的区别在于extend是将所有的属性和方法都添加到构造函数的原型中。这样基于该构造函数创建的对象实例都将自动包含混入的新属性和方法。 通过extend后,可以发现在ManMythLength对象的原型的构造函数中,出现了x:10,y:20,z:30。这样其他通过 ManMythLength构造函数创建的对象都有了这些属性。...原创 2012-03-22 10:48:08 · 81 阅读 · 0 评论 -
dojo.mixin
dojo.mixin用于把几个对象实例的属性混合在一起。 var book = { size:10, color:"green" }; function children(name){ this.name = name; }; var ch = new children("test"); var obj = new Object(); dojo.mixin...原创 2012-03-22 10:24:54 · 319 阅读 · 0 评论 -
dijit._Contained源码
define("dijit/_Contained", ["dojo", "dijit"], function(dojo, dijit) { dojo.declare("dijit._Contained", null, { // summary: // Mixin for widgets that are children of a container wi...原创 2012-04-28 22:39:40 · 130 阅读 · 0 评论 -
dojo.place
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>index</title> <meta http-equiv="Content-Type" content="text/ht原创 2012-05-09 21:22:05 · 276 阅读 · 0 评论 -
xhrGet
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>dojoXhr</title> <meta http-equiv="Content-Type" content="原创 2012-03-05 10:07:23 · 119 阅读 · 0 评论 -
dojo数组处理
1. 数组中数据的查询 //方法原型dojo.indexOf(Array array, Any value, Integer fromIndex) //找不到返回-1 //例子: var a = dojo.indexOf(["foo","bar"],"baz"); //-1 var b = dojo.indexOf([1,3,5], 5); //2 ...原创 2012-03-13 12:51:50 · 115 阅读 · 0 评论 -
djConfig
djConfig是一个配置开关,可以把它放在启动工具箱的script标签中。 <script src="http://ajax.googleapis.com/ajax/libs/dojo/1.7.1/dojo/dojo.js" data-dojo-config="async: true, parseOnLoad: true"> </script> ...原创 2012-03-13 13:20:31 · 158 阅读 · 0 评论 -
dojo新建模块
1. dojo.baseUrl 默认值是dojo的根目录,比如dojo.js的路径是在/web/scripts/dojo-1.3/dojo/dojo.js,那么这个baseUrl就是/web/scripts/dojo-1.3/dojo/ . <!DOCTYPE HTML> <html lang="en"> <head> <...原创 2012-03-13 14:55:30 · 84 阅读 · 0 评论 -
dojo.connect
dojo的connect方法主要有两个作用: 1.函数链式的调用 当一个函数被调用,通过dojo.connect可以使另一个函数也被调用,像链条一样触发。 <!DOCTYPE HTML> <html lang="en"> <head> <meta charset="utf-8"> <tit原创 2012-03-14 19:40:01 · 257 阅读 · 0 评论 -
dojo.toJson
<!DOCTYPE HTML> <html lang="en"> <head> <meta charset="utf-8"> <title>Demo</title> <script src="dojo16/dojo/dojo.js" dat原创 2012-03-15 11:10:39 · 204 阅读 · 0 评论 -
dojo.fromJson
<!DOCTYPE HTML> <html lang="en"> <head> <meta charset="utf-8"> <title>Demo</title> <script src="dojo16/dojo/dojo.js"原创 2012-03-15 11:27:31 · 305 阅读 · 0 评论 -
dojo.parser
Dojo.parser的一个最主要的工作是控制小部件的生成。 工作步骤: <div dojoType = "dojobook.creating_widgets.widgets.GreekingWidget" paragraphs = "1" sentencesPer = "1" IoremIpsum = "true" style= "width:200px...原创 2012-03-22 09:24:10 · 124 阅读 · 0 评论 -
js对象
在js中每个对象都会包含另一个对象的引用,这个引用对象的对象被称为当前对象的原型。由于原型本身也是一个对象,因此它也包含对它原型的引用。 比如一个函数Man function Man(){ this.x = 10; } 那么他对应有两个属性,一个是x,一个是_proto_,它就是当前对象的原型的引用。 其实可以知道,他是指向Man对象的,而对于...原创 2012-03-22 10:07:35 · 69 阅读 · 0 评论 -
dojo语句执行顺序
dojo.declare("Test", null, { myData : null, myFunc : function() { alert(this.myData); console.log("4"); }, constructor : function() { console.log("1"); dojo.xhrGet({ url :...原创 2012-04-21 09:28:57 · 134 阅读 · 0 评论