<div id="searchContainer" data-dojo-type="addInWindow/TreeSearchBar"></div>
将div改造成我们自己定义的treesearchbar
addInWindow在common/config里面配置成模块
{
name: "addInWindow",
location: "/scvmmPage/AddInWindow/js" //重定向的地址
}
var dojoConfig = {
async: true,
isDebug: false,
parseOnLoad: true,
has: {
"dojo-firebug": false,
"dojo-debug-messages": false
},
locale: config_i18n.getLanguage(),
baseUrl: "/common/dojost",
trace: {
level: "warn"
},
packages: [
{
name: "augusta",
location: "/common/augusta"
}
]
}
所以找到了js目录下的
TreeSearchBar.js
define([
'dojo/_base/declare', 'dojo/on', 'dojo/_base/lang', 'dojo/keys', 'dojo/dom-style',
'dijit/_WidgetBase', 'dijit/_TemplatedMixin', 'dijit/_WidgetsInTemplateMixin',
'dijit/form/TextBox', 'dijit/form/Button',
'cbtree/Tree',
'dojo/text!/scvmmPage/AddInWindow/template/TreeSearchBar.html'
]
通过define将template下的html找到当作代替div的东西
define使用格式如下:
// 使用示例 2
define(
["dijit/layout/TabContainer", "bd/widgets/stateButton"],
function(TabContainer, stateButton){
// do something with TabContainer and stateButton...
return definedValue;
}
);
define(
["dijit/layout/TabContainer", "bd/widgets/stateButton"],
function(TabContainer, stateButton){
// do something with TabContainer and stateButton...
return definedValue;
}
);