Show Posts
|
Pages: [1]
|
2
|
General Category / EasyUI for jQuery / Re: UI Tree change behavior
|
on: July 03, 2015, 04:10:11 AM
|
Hi!
I explained badly on this
behavior is the same (1) become indeterminate.
Ment to say
behavior is the same (1) become checked.
Thanks for helping. When include your code, I'm not able to check (1), only (1.1) and (1.2).
Can you give me a clue?
Thanks Joao
|
|
|
3
|
General Category / EasyUI for jQuery / UI Tree change behavior
|
on: June 26, 2015, 02:33:45 AM
|
Hi!
In a structure like this
1 --- 1.1 --- 1.2
When I click (1) is it possible to reverse the process? instead of check 1.1 and 1.2 automatically, I want to unchecked, but when I check (1.1, 1.2) the behavior is the same (1) become indeterminate.
Thanks Joao
|
|
|
4
|
General Category / EasyUI for jQuery / Re: Clone Tree View
|
on: May 26, 2015, 03:03:15 AM
|
Thank You Jarry! Since i'm writing in a DB this procedure works GEAT! Send Datavar t1 = $("#tt"); // the source tree var data = t1.tree("getData", t1.tree("getRoot").target); var jdata = JSON.stringify(data); Get Datavar jdata = JSON.parse(value.FIELD); $("#treev").html(""); var treev = $("<ul id=\"tt\" class=\"list-group easyui-tree\" " + "data-options=\"animate:true,checkbox:true,cascadeCheck:true,lines:true\">" + "</ul>").appendTo("#treev"); treev.tree({ data: $.extend(true, [], [jdata]) });
|
|
|
5
|
General Category / EasyUI for jQuery / Clone Tree View
|
on: May 25, 2015, 08:06:10 AM
|
Hi All! Is there a way to clone a Tree and become available for clicking? var $treea = $("#tt").clone(); var $treeb = $("#ttb"); $treeb.append($treea); After clone Javascript is not assumed. Thanks Joao
|
|
|
7
|
General Category / EasyUI for jQuery / TREE | How to know "indeterminate's" with "getChecked"
|
on: April 15, 2015, 02:40:38 AM
|
Hi, i think this is a easy question, here it goes How to know "indeterminate's" with "getChecked"? Thanks nodes[i].id //This ID is indeterminate
function getChecked() { var nodes = $('#tt').tree('getChecked', ['checked', 'indeterminate']); var s = ''; for (var i = 0; i < nodes.length; i++) { if (s !== '') s += ','; s += nodes[i].id; } alert(s); }
|
|
|
9
|
General Category / EasyUI for jQuery / Re: UI Tree load Object Json
|
on: April 11, 2015, 09:15:42 AM
|
Hi, i can query the data now, but can i change the Field names in this sample? http://www.jeasyui.com/tutorial/tree/tree6.phpMy one is "{"DepId":7,"DepParentId":3,"Title":"OTT"}" So changes to function exists(rows, parentId) { for (var i = 0; i < rows.length; i++) { if (rows[i].DepId === parentId) return true; } return false; }
var nodes = []; // get the top level nodes for (var i = 0; i < rows.length; i++) { var row = rows[i]; if (!exists(rows, row.DepParentId)) { nodes.push({ id: row.DepId, text: row.Title }); } }
var toDo = []; for (var i = 0; i < nodes.length; i++) { toDo.push(nodes[i]); } while (toDo.length) { var node = toDo.shift(); // the parent node // get the children nodes for (var i = 0; i < rows.length; i++) { var row = rows[i]; if (row.DepParentId === node.id) { var child = { id: row.DepId, text: row.Title }; if (node.children) { node.children.push(child); } else { node.children = [child]; } toDo.push(child); } } } return nodes; }
But give me error that row.DepParentId or rows[xxxx].DepId is UNDEFINED Jesus, simple things can get complicated  Working in Fiddle https://jsfiddle.net/0drgksmd/3/
|
|
|
10
|
General Category / EasyUI for jQuery / Re: UI Tree load Object Json
|
on: April 10, 2015, 05:37:51 AM
|
Hi!, thanks for helping. After "loadFilter:" nothing runs and i have no JavaScript error, any more suggestion? missing something? I think without the "url:" something get's wrong, or I'm wrong ExecuteOrDelayUntilScriptLoaded(function () { var context = new SP.ClientContext("/"); var list = context.get_web().get_lists().getByTitle("Departamentos");
var viewXml = "<View><RowLimit>1200</RowLimit></View>"; var query = new SP.CamlQuery(); query.set_viewXml(viewXml); var items = list.getItems(query); context.load(items, "Include(DepId,DepParentId,Title)");
var deps = [];
function onLoaded() { $('#tt').tree({ loadFilter: function(data, parent) { var itemsCount = items.get_count(); for (var i = 0; i < itemsCount; i++) { var item = items.itemAt(i); data = JSON.stringify(item.get_fieldValues()); deps.push(data); } return data; } }); }
context.add_requestSucceeded(onLoaded);
function onFailure() {
}
context.add_requestFailed(onFailure); context.executeQueryAsync(); }, "sp.js");
|
|
|
11
|
General Category / EasyUI for jQuery / UI Tree load Object Json
|
on: April 10, 2015, 01:39:17 AM
|
Hi All! This is my 1st post, i´m evaluating this component's and i have a question that may be easy. Trying to integrate with SharePoint a Tree object, but having problems getting the data for binding. This is my main code thar return a Json object Object Array in Json Format "deps" function getDepartamentos() { var context = new SP.ClientContext("/"); var list = context.get_web().get_lists().getByTitle("Departamentos");
var viewXml = "<View><RowLimit>1200</RowLimit></View>"; var query = new SP.CamlQuery(); query.set_viewXml(viewXml); var items = list.getItems(query); context.load(items, "Include(DepId,DepParentId,Title)");
function onLoaded() { var deps = []; var itemsCount = items.get_count(); for (var i = 0; i < itemsCount; i++) { var item = items.itemAt(i); var dep = JSON.stringify(item.get_fieldValues()); deps.push(dep); }
return deps; }
context.add_requestSucceeded(onLoaded);
function onFailure() {
}
context.add_requestFailed(onFailure); context.executeQueryAsync();
$("#tt").tree({ }); }
I have another code that get's the Id and Parent unction convertToTree(rows) { function exists(rows, parentId) { for (var i = 0; i < rows.length; i++) { if (rows[i].id == parentId) return true; } return false; }
var nodes = []; // get the top level nodes var row; var i; for (i = 0; i < rows.length; i++) { row = rows[i]; if (!exists(rows, row.parentId)) { nodes.push({ id: row.id, text: row.name }); } }
var toDo = []; for (i = 0; i < nodes.length; i++) { toDo.push(nodes[i]); } while (toDo.length) { var node = toDo.shift(); // the parent node // get the children nodes for (i = 0; i < rows.length; i++) { row = rows[i]; if (row.parentId == node.id) { var child = { id: row.id, text: row.name }; if (node.children) { node.children.push(child); } else { node.children = [child]; } toDo.push(child); } } } return nodes; }
How can i load this in? without a URL $("#tt").tree({ }); Thank You Joao
|
|
|
|