init
This commit is contained in:
parent
06f61d8ce8
commit
f301cb744d
2271 changed files with 103162 additions and 0 deletions
23
02-ui/05-widgets/08-widget-tasks-2/05-tree-checkboxes/solution/fetch.js
Executable file
23
02-ui/05-widgets/08-widget-tasks-2/05-tree-checkboxes/solution/fetch.js
Executable file
|
@ -0,0 +1,23 @@
|
|||
var result = {
|
||||
0: { children: [] }
|
||||
};
|
||||
|
||||
$('div[id^="region"]').each(function() {
|
||||
el = $(this);
|
||||
var id = el.attr('id').slice(6);
|
||||
result[id] = {
|
||||
title: el.children('label').html(),
|
||||
children: [],
|
||||
id: id
|
||||
};
|
||||
|
||||
var parent = el.parent().closest('div[id^="region"]');
|
||||
if (parent.length) {
|
||||
var pid = parent.attr('id').slice(6);
|
||||
} else {
|
||||
pid = 0;
|
||||
}
|
||||
|
||||
result[pid].children.push(+id);
|
||||
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue