Tag:

杰森回来参考

我有一个分层的json对象,我想遍历它并将父节点附加到每个元素。 这就是我所做的 function attach_back_reference(hierarchy, parent){ hierarchy.parent = parent; for(var i in hierarchy){ if(jQuery.isPlainObject(hierarchy[i])) attach_back_reference(hierarchy[i], hierarchy); } } 但这是错误的。 Maximum call stack size exceeded

AJAX从JSON树获取

我刚刚开始使用AJAX,尝试使用JQuery的$ .getJSON函数(或任何相关的,即$ .load(),$ .ajax()等)。 我有一个JSON文件,其结构如下: [ { “id”: 1, “email”: “user@domain.com”, “password”: “password” }, { “id”: 2, “email”: “one@two.com”, “password”: “password” } ] 如何为具有特定电子邮件的用户调用此JSON文件(我们称之为users.json)的GET? 我认为这将是$ .getJSON中的第二个参数,但这似乎只是返回整个树。 谢谢!

有没有人为数千个节点生成虚拟化的javascript树?

我正在尝试将应用程序移动到包含多达50,000个节点的树的Web。 我首先尝试使用jqxtree小部件来生成它,但是DOM太大了,它们显然不支持数千个节点。 我正在寻找一个虚拟解决方案,虽然我已经看到了几个包含数百万个项目的列表示例,但我还没有看到一个使用树的工作。 还有其他人做过吗? 可能吗? 树不需要拖放等任何function。 它只是一个展开/折叠/点击事件。

动态选中/取消选中树中的复选框

我有一个类似于Uncheck父节点的问题, 如果在JQuery中取消选中所有子节点 (使用此解决方案)并尝试修改它,以便子节点也将取消选中父节点未选中(上面/下面无法执行)。 上面的JSFiddle( http://jsfiddle.net/fRxVs/ ) jQuery.each(jQuery(‘#treeList ul li’).find(‘:checkbox’), function(){ jQuery(this).change(function (){ if (jQuery(this).is(‘:checked’)) { jQuery(this).parentsUntil(‘#treeList’).siblings().filter(‘input:checkbox’).attr(‘checked’, true).trigger(‘change’); }else{ jQuery(this).parents(‘ul:first’).siblings(‘input:checkbox’).prop(‘checked’, $(this).parent().siblings().children(‘input:checked’).length).trigger(‘change’); } }); }); 虽然我不知道为什么,但我不得不将prop从最后一行改为attr ,以便它因为某种原因在本地正确地作为JSFiddle工作…… 基本上我有3级设置: Grand-Parent – Parent — Child 如果选中/取消选中grandparent ,则其子女和孙子女也应该被选中/取消选中。 如果选中/取消选中parent ,则应检查/取消选中其子级及其父级。 如果检查子项,则应检查其父项和祖父项(如果未检查子项,则不应检查父项)。 我正在尝试将其更改为大陆,国家,地区 – 我想你会理解我是否只是这样说…. 谢谢

jqTree – 从json创建树数据

我正在尝试使用jqTree显示树 – http://mbraak.github.com/jqTree 我需要帮助从JSON创建树数据。 我的JSON数据如下所示: { “d” : { “results”: [ { “Title”: “Committee A”, “ReportsToId”: null, “Rank”: 1, “Id”: 5 }, { “Title”: “Committee B”, “ReportsToId”: 5, “Rank”: 2, “Id”: 7 }, { “Title”: “Committee C”, “ReportsToId”: 7, “Rank”: 3, “Id”: 13 }, { “Title”: “Committee D”, “ReportsToId”: 13, “Rank”: 4, “Id”: 1 }, […]

任何人都知道JQuery插件在geni.com上生成树状菜单

Hello Everyone我几个小时都在徘徊,找到一个Jquery插件来生成一个像geni.com上的树状菜单模块,如果有人知道Jquery中的这样一个插件或脚本,请让我知道或指导我如何使用Jquery开发这样的function? 请检查我在寻找什么http://www.geni.com/family-tree/index/6000000010663773201它是在Flash中开发的,但我想在Jquery中创建相同的东西。 请帮帮我。 谢谢

js / jQuery Drag’n’Drop,重新计算掉落目标

我有以下问题,我有一个大树,其子节点可以根据需要折叠和展开(节点内的数据用AJAX获取)。 但是,我使用jquery.event.drop / drag来创建拖放目标。 然而,当我折叠/展开掉落目标改变位置,我需要重新计算。 这就是我想要这样做的方式: function create_drop_targets() { $(‘li a’) .bind(‘dropstart’, function(event) { }) .bind(‘drop’, function(event) { }) .bind(‘dropend’, function(event) { }); } 折叠/展开时调用create_drop_targets()。 但是,这不起作用。 我在jquery.event.drop中找到了以下内容: var drop = $.event.special.drop = { setup: function(){ drop.$elements = drop.$elements.add( this ); drop.data[ drop.data.length ] = drop.locate( this ); }, locate: function( elem ){ // return { […]

jquery文件树 – 默认情况下打开文件夹?

我想知道是否有人可以帮我解决jQuery文件树( jQuery文件树 ) 我想知道是否/如何设置某种变量将告诉文件树在加载时打开某个文件夹。 (例如,文件夹/ images / fruit /默认打开) 这是调用filetree的代码: $(‘#container_id’).fileTree({ root: ‘/images/’ }, function(file) { alert(file); }); 这是filetree.js文件: // jQuery File Tree Plugin // // Version 1.01 // // Cory SN LaViska // A Beautiful Site (http://abeautifulsite.net/) // 24 March 2008 // // Visit http://abeautifulsite.net/notebook.php?article=58 for more information // // Usage: $(‘.fileTreeDemo’).fileTree( options, callback […]

如何使用jquery查找和检查树中的所有动态子复选框?

我已动态地向所有元素添加了复选框,并成功添加了选中所有复选框的function,但无法在树结构中选择父子复选框,这意味着如果我选择“亚洲”,则应选择所有“Estern Asia “和”南亚“,如果我选择Estern Asia,它应该选择所有国家,反之亦然。 var json ={“Asia”: [{“regionList”: [{“regionName”: “Eastern Asia”,”Countrylist”: [{“countryName”: “China”,”subCountryList”: [{“subCountryName”: “Southern China”},{“subCountryName”: “Eastern China”}]},{“countryName”: “Hong Kong”}]},{“regionName”: “Southern Asia”,”Countrylist”: [{“countryName”: “India”},{“countryName”: “Pakistan”}]}]}]}; var html = ”; $.each(json, function(i1, object) { html += ” + i1 + ”; $.each(object, function(i2, continent) { html += ”; $.each(continent.regionList, function(i3, region) { html += ” + […]

如何使用JavaScript为JSON / XML数据生成MLM(多级营销)树

我有一些这样的数据:(AT sql sERVER) MemberID,ParemtID,Amt,OtherInfo 1, NULL, 200,dfdsf 2, 1, 300,DFDF 3, 1, 400,DFS 4, 3, 75,NULL 现在我想要像这样构建树 : 只使用JS。 以上数据可以用JSON / XML / CSV /格式化文本传递如何只在JS中生成这样的动态树? 请不要建议PHP / .NET解决方案。 我更喜欢JQuery。