dojo

Dojo学习11 dojo类属性查看工具

不问归期 提交于 2019-12-20 20:59:55
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 11. dojo类属性查看工具 有的时候查询一个类的方法,属性比较费事,还得看源代码,而且,有的是继承类,需要看不止一个源代码。今天我写了一个dojo的属性查看器,能够方便的查看一个类的所有属性和方法。 用的时候注意和dojo.js的相对路径: js |-dojo | |-dojo.js |-dijit |- .... my |-showDetail.htm ==================showDetail.htm====================== <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Button Widget Dojo Tests</title> <style type="text/css"> @import "../js/dojo/resources/dojo.css"; @import "../js/dijit/themes/tundra/tundra.css"; </style> <script type="text/javascript" djConfig="parseOnLoad: true,

JS中class的实现方式,另模拟dojo.declare

ⅰ亾dé卋堺 提交于 2019-12-20 20:58:04
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 首先写一个简单的类。 function Animal(nickName){ this.getNickName = function(){return nickName}; } Animal.prototype.canMiaomiao=false; Animal.prototype.eat=function(){console.log("animal eat");}; Animal.prototype.sleep=function(){console.log("animal sleep");}; 上面实现了一个普通动物的类。nickName为其私有域,canSpeak为公有域。此类还有三个方法 getNickName, eat, sleep。 然后写一个子类。 function Cat(nickName, color) { this.superClass(nickName); this.getColor=function(){return color;}; } Cat.prototype=new Animal(); Cat.prototype.constructor=Cat; Cat.prototype.superClass=Animal; Cat.prototype.canMiaomiao=true; Cat

用dojo生成全代码form的工具

瘦欲@ 提交于 2019-12-20 20:57:49
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> /* * author:sjbwylbs,email:sjbwylbs@163.com */ dojo.provide("ijqg.utils.FormHelper"); dojo.require("dijit.form.Button"); dojo.require("dijit.form.Button"); dojo.declare("ijqg.utils.FormHelper", [], { className : "FormHelper", constructor:function(className) { this.className=className; }, addButton : function(pane, name, action) { var button = new dijit.form.Button({ label : name }); pane.appendChild(button.domNode); button.onClick = action; return button; }, addSpan : function(pane,name,title) { var dom= dojo.create("span", { id : this.className + name,

dojo.mixin(混合进)、dojo.extend、dojo.declare

北慕城南 提交于 2019-12-20 20:55:39
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> dojo源码里,大量使用 dojo.mixin、dojo.extend、dojo.declare 三个方法。作用均为扩展dojo基类。 一、dojo.mixin dojo.mixin用于扩展一个实例对象,如 var obj = {a:1,b:2} dojo.mixin(obj,{c:3,d:4}) 那么现在的obj为{a:1,b:2,c:3,d:4} 二、dojo.extend dojo.extend用于扩展一个类对象,在实际应用中我主要用来扩展dojo控件。如给dijit.Dialog扩展一个setTitle方法 dojo.extend(dijit.Dialog,{ setTitle:function(name){ this.set('title',name) } }) 这样在创建Dialog对象后,就包含的 setTitle 的方法。 三、dojo.declare dojo.declare在控件里被大量应用,原因是dojo.declare可以声明一个类,而不污染继承的类。可以用面向对象语言里的多重继承理解。比如 我要声明一个对话框类,这个对话框有特殊的样式。 dojo.declare( "myDialog", dijit.Dialog, { style:..., setTitle:function(...)

dojo.mixin、dojo.extend、dojo.declare

為{幸葍}努か 提交于 2019-12-20 20:55:28
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> dojo源码里,大量使用 dojo.mixin、dojo.extend、dojo.declare 三个方法。作用均为扩展dojo基类。 一、dojo.mixin dojo.mixin用于扩展一个实例对象,如 var obj = {a:1,b:2} dojo.mixin(obj,{c:3,d:4}) 那么现在的obj为{a:1,b:2,c:3,d:4} 二、dojo.extend dojo.extend用于扩展一个类对象,在实际应用中我主要用来扩展dojo控件。如给dijit.Dialog扩展一个setTitle方法 dojo.extend(dijit.Dialog,{ setTitle:function(name){ this.set('title',name) } }) 这样在创建Dialog对象后,就包含的 setTitle 的方法。 三、dojo.declare dojo.declare在控件里被大量应用,原因是dojo.declare可以声明一个类,而不污染继承的类。可以用面向对象语言里的多重继承理解。比如 我要声明一个对话框类,这个对话框有特殊的样式。 dojo.declare( "myDialog", dijit.Dialog, { style:..., setTitle:function(...)

Dojo学习9 带背景遮罩的对话框:dijit.Dialog

独自空忆成欢 提交于 2019-12-20 20:41:07
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 9. 带背景遮罩的对话框:dijit.Dialog 这个对话框通用性非常好。而且显示效果比较友好,能给使用者很好的体验。而且无论是正常方式,还是编程方式,实现起来都比较简单。 对话框包括两种,一种是普通的对话框,一种是提示窗口的对话框,用起来都很方便。 下面是一个普通的对话框: <html> <head> <title>Dialog</title> <style type="text/css"> @import "../js/dojo/resources/dojo.css"; @import "../js/dijit/themes/tundra/tundra.css"; </style> <script type="text/javascript" djConfig="parseOnLoad: true, isDebug: true" src="../js/dojo/dojo.js"></script> <script type="text/javascript"> dojo.require("dijit.Dialog"); function showDia(){ dijit.byId("dialog1").show(); } </script> <style> .dijitDialogUnderlay {

How do I connect a django rest framework json query result to dgrid/OnDemandGrid

老子叫甜甜 提交于 2019-12-20 05:14:27
问题 My JSON store (django rest framework) returns keys for "count", "next", "previous", and "results". "count" is the number of rows available. "next" is the url for the next page of results (e.g. ids 26-50). "previous" is the url for the previous page of results (null in this case since this is the first page of results). The "results" key contains the actual data objects I'd like to display in the OnDemandGrid. How do I connect the "results" key data collection to the grid? Thank you for your

AMD Loader disable, enable in theme

99封情书 提交于 2019-12-20 04:53:53
问题 I have a problem with the AMD Loader. I want bind the bootstrap-slider.js and the css into the application. All the javascript and css are declare in a theme. Now the slider js don't harmonize with the dojo js. I found the explains from Marky Roden and the XSnippet von Ferry Kranenburg. In the custom control the code is very good. But I want all that in the theme for all the application. But it don't work. Can I disable, enable the AMD Loader in a theme? 回答1: I think that's possible. Create 2

dgrid 0.4.0 tree looks flat before user interacts

雨燕双飞 提交于 2019-12-20 04:53:32
问题 Trying to use dgrid 0.4.0 to display a tree structure. (no prior experience with previous versions 0.3.x). I built this sample with two folders : alice and bob ; each would have a few files (leaves) in it. The store ("astore.js") define(['dojo/_base/declare', './dstore/Memory', './dstore/Tree'], function(declare, Memory, Tree) { var store = new (declare([Memory, Tree], {}))(); store.add({node:'bob', id:1, parent:null, hasChildren:true}); store.add({node:'alice', id:2, parent:null, hasChildren

How to run .sh files in Windows?

北城以北 提交于 2019-12-20 02:57:17
问题 I download some repositories of DojoToolkit in GitHub that have .sh files, I know .sh extension are typically shell scripts written in Unix, but exist a way to run this in Windows? 回答1: cygwin is probably the easiest way. http://www.cygwin.com/ Alternatively if you're already using git-bash for github etc you can use it to run .sh scripts too. 回答2: Porting unix stuff to windows is sometime possible (mostly thanks to cygwin, as pointed out by other answers) but except for simple stuff, you'll