我已经创建了对数据执行特定操作的插件,现在我想以某种方式加入我的插件以与 ex 一起使用。jQuery 对话框。我怎样才能做到这一点?
这是简化的情况:
(function($) {
$.fn.jquerytoc = function(map, layersConfig, layersList) {
var opts = $.extend($.treeview, $.fn.jquerytoc.defaults, map, layersConfig, layersList);
var TOC = {
map : opts.map,
layersConfig : opts.layersConfig,
TOCinfos : {},
getRequiredData : function() {
},
init : function() {
this.getRequiredData();
}
};
var HTML = {
nodes : TOC.TOCinfos,
data : [],
htmlObject : {},
jqTreeObject : {},
setHTMLcode : function() {
var object = this.data;
var objectNode = {};
var nodes = this.nodes;
console.log(nodes);
for (var node in nodes) {
objectNode = {};
objectNode.label = nodes[node].name;
objectNode.children = [];
var sublayers = nodes[node].sublayers;
for (var sublayer in sublayers) {
objectNode.children.push({
'label' : sublayers[sublayer]
});
};
object.push(objectNode);
};
},
init : function(object) {
this.htmlObject = object;
this.setHTMLcode();
}
};
function init() {
TOC.init();
HTML.init(this);
}
return this.each(function() {
init();
//AND HERE I WOULD LIKE TO WRAP MY DOM ELEMENT WITH JQUERY DIALOG
jQuery.dialog(this);
});
}
})(jQuery);
但我总是知道 jQuery 方法对话框是undefined
. 我尝试了很多方法,但总是得到同样的错误。我很乐意提供帮助!谢谢!:)