Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //JavScript
- $.getJSON('data.json', function (data) {
- console.log("DATA", data);
- $.each(data, function (i, f) {
- $(".container").append("<div style='margin-left:" + f.level * 15 + "px'>" + (f.name) + " = " + (f.balance) + "<span id ='collapse" + i + "'></span></div>")
- //Json
- [
- {
- "name": "Balance Sheet",
- "level": 0,
- "account_type": "sum",
- "balance": -27150010963.0,
- "type": "report"
- },
- {
- "name": "Assets",
- "level": 1,
- "account_type": "account_type",
- "balance": 19636000.0,
- "type": "report"
- },
- {
- "name": "12301 Piutang Dagang",
- "level": 4,
- "account_type": "receivable",
- "balance": 19636000.0,
- "type": "account"
- },
- {
- "name": "Liability",
- "level": 1,
- "account_type": "sum",
- "balance": -27169646963.0,
- "type": "report"
- },
- {
- "name": "Liability",
- "level": 2,
- "account_type": "account_type",
- "balance": -27169646963.0,
- "type": "report"
- },
- {
- "name": "21101 Hutang Usaha - Pemasok",
- "level": 4,
- "account_type": "payable",
- "balance": -5432435.0,
- "type": "account"
- },
- {
- "name": "21102 Hutang Usaha - bukan Pemasok",
- "level": 4,
- "account_type": "payable",
- "balance": -27164214528.0,
- "type": "account"
- },
- {
- "name": "Profit (Loss) to report",
- "level": 2,
- "account_type": "account_report",
- "balance": 0.0,
- "type": "report"
- }
- ]
- //HTML
- <div class="container"> </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement