
Security News
npm v12 Ships With Install Scripts Off by Default, Begins Deprecating 2FA-Bypass Tokens
npm v12 is generally available, turning install scripts off by default and beginning the deprecation of 2FA-bypass publishing tokens.
orgtreeselect
Advanced tools
dist/
├── index.umd.js (UMD)
└── style.min.css (CSS, compressed)
In browser:
<script src="https://code.jquery.com/jquery-1.11.2.min.js "></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.1/jquery.validate.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validation-unobtrusive/3.2.12/jquery.validate.unobtrusive.min.js"></script>
let myTree = new OrgTreeSelect(element, (options = {}));
element
Stringoptions (optional)
Object<div id="tree"></div>
// 宣告 orgTreeSelect
let myTree = new OrgTreeSelect("#tree");
// set options
myTree.setOptions({
data: _data,
texts: {
treeTitle: "部門列表",
selectText: "請選擇",
},
showAdd: true,
showEdit: true,
showDelete: true,
showCheckbox: true,
onEdit: (node) => {
myTree.openEditDialog({
mode: 'edit',
title: "編輯",
node: node,
texts: {
id: "Id",
text: "內容",
save: "儲存",
close: "取消",
error_null: "請填寫此選項。"
},
onSave: function(dialog, formData) {
node.text = formData.text;
let isSuccess = myTree.updateNode(node);
return isSuccess;
},
});
},
// onAdd methods
onAdd: (node) => {
myTree.openEditDialog({
mode: 'add',
title: "新增",
node: node,
texts: {
id: "Id",
text: "內容",
save: "儲存",
close: "取消",
error_invalid: "此Id已重複使用",
error_null: "請填寫此選項。"
},
onSave: function(dialog, formData) {
let newNode = {
id: formData.nid,
text: formData.text,
nodes: []
}
let parent = myTree.getNode(node.id);
let isSuccess = myTree.addNode(parent, newNode);
return isSuccess;
},
});
},
// onDelete methods
onDelete: (node) => {
myTree.openDeleteDialog({
mode: 'delete',
title: "刪除",
node: node,
texts: {
id: "Id",
text: "內容",
close: "取消",
delete: "刪除"
},
onSave: function(node) {
let isSuccess = myTree.deleteNode(node);
return isSuccess;
},
});
}
});
Type: Array, an Array of node objects
Default: []
note: node object:
{id: str, text: str, nodes: [] }
至少要有id和text兩個key,子物件要放在nodes裡面。
如果傳入的data有這三項key以外的key,在建構tree時會一律放在 except的key下面。
StringnullStringnullBooleanFalseBooleanFalseBooleanFalseBooleanTrueFunctionnullFunctionnullFunctionnullSet Option to Tree
objectSelect Node by Id
StringUnselect Node by Id
StringGet Node Object by Id
ObjectGet Parent Node Object by Id
ObjectGet All Sibling Node Object by Id
ArrayGet All Child Node Object by Id
ArrayGet Selected Tags, Ingore Mother-Child Repeataion
ArrayOpen Edit/Add Dialog
options
Object{
mode: ['edit' | 'add'],
title: {String},
node: {Object},
onSave: {function}
}
Open Delete Dialog
options
Object{
mode: ['delete'],
title: {String},
node: {Object},
onSave: {function}
}
Update Node
ObjectBooleanAdd Node
ObjectObjectBooleanDelete Node
ObjectBooleanFAQs
This is a tree select plugin.
The npm package orgtreeselect receives a total of 4 weekly downloads. As such, orgtreeselect popularity was classified as not popular.
We found that orgtreeselect demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
npm v12 is generally available, turning install scripts off by default and beginning the deprecation of 2FA-bypass publishing tokens.

Research
/Security News
Socket tracks the activity as Operation “Muck and Load”: a threat actor uses commit-farming workflows, public dead drops, and protected archives to stage Windows RAT and infostealer malware.

Security News
pnpm 11.10 hardens registry auth to block token redirection, tightens pack-app and deploy, and makes the Rust port (v12) installable.