Created
May 27, 2016 04:49
-
-
Save goofmint/9f52c233d2f6f4819ca9a39557ff69e3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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