Skip to content

Instantly share code, notes, and snippets.

@goofmint
Created May 27, 2016 04:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goofmint/9f52c233d2f6f4819ca9a39557ff69e3 to your computer and use it in GitHub Desktop.
Save goofmint/9f52c233d2f6f4819ca9a39557ff69e3 to your computer and use it in GitHub Desktop.
var applicants = ['satoshi', 'takeshi', 'kasumi', 'haruka'];
var statuses = ['new', 'investigation', 'approved', 'closed', 'rejected'];
function createTreeDatas() {
treeDatas = [{
id: 'all',
parent: '#',
icon: 'jstree-file',
text: '全て'
}, {
id: 'applicant',
parent: '#',
text: '申請者別',
state: {
opened: true
}
}, {
id: 'status',
parent: '#',
text: 'ステータス別',
state: {
opened: true
}
}, {
id: '10000*100',
parent: '#',
text: '10000×100',
icon: 'jstree-file'
}, {
id: '10000*10000',
parent: '#',
text: '10000×10000',
icon: 'jstree-file'
}];
// 申請者別
for (var i = 0, l = applicants.length; i < l; i++) {
var applicant = applicants[i];
treeDatas.push({
id: 'applicant.' + applicant,
parent: 'applicant',
icon: 'jstree-file',
text: applicant
});
}
// ステータス別
for (var i = 0, l = statuses.length; i < l; i++) {
var status = statuses[i];
var text = sample.util.statusTextMap[status];
treeDatas.push({
id: 'status.' + status,
parent: 'status',
icon: 'jstree-file',
text: text
});
}
return treeDatas;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment