I have an object for like this:
var obj = {
c: {
games: {
game1: {
howToPlay: { files: ['instructions.txt'] },
files: ['characters.txt', 'wildCards.txt']
},
game2: { files: ['credits.txt'] }
}
'program files': {
microsoft: { files: ['ieShortcuts.txt'] }
}
logs {
zipped: { files: ['bigfile.txt'] },
files: ['log1', 'log2', 'log3', 'log4', 'log5']
}
...
}
...
}开发者_运维百科
I want to generate a treeview-like structure from this object I want to implement a way to select certain files (with checkboxes next to them, empty for none selected, checked for all, and filled for partially; using <img />) and have the order of files in the same folder sortable.
Something like this:
My end result is to spit back the contents of the selected files in the order that the user specified.
Is there any way to accomplish this through a jQuery plugin or combination of plugins? I started writing this from scratch but the sheer complexity seems beyond me
i think jstree is the leading treeview plugin for jquery right now. i find it a bit clunky to use, but it gets the job done.
Check out the TreeView component by ShieldUI.
You can customize it however you like and supports all kinds of features.
精彩评论