

var dashboard = {
	"type": "wide",
	"css": "dashboard",
	"rows": [
		{ "view": "toolbar", "css": "webix_dark", "padding": { "right": 10, "left": 10 },
			"elements": [
				{ "view": "menu", "id": "menu", "subMenuPos": "bottom", "submenuConfig": { "autowidth": true },
					"data": [
						{
							"value": "SFM",
							"icon": "wxi-dots",
							"submenu": [
								{ "value": "Summary", "icon": "wxi-calendar" },
								{ "value": "Pending Jobs", "icon": "mdi mdi-notebook-check" },
								{ "value": "Mass Mailing", "icon": "mdi mdi-email" },
								{ "$template": "Separator" },
								{ "value": "Logout", "icon": "mdi mdi-exit-run" }
							]
						},
						{
							"value": "Loans",
							"autowidth": true,
							"icon": "mdi mdi-bank-transfer",
							"submenu": {
								"data": [
									{ "value": "Add", "icon": "mdi mdi-table-column-plus-before" },
									{ "$template": "Separator" },
									{ "value": "Export", "icon": "mdi mdi-file-export" },
									{ "value": "Import", "icon": "mdi mdi-file-upload" },
									{ "$template": "Separator" },
									{ "value": "New", "icon": "mdi mdi-file-export", "badge": "20" },
									{ "value": "Submitted", "icon": "mdi mdi-file-upload", "badge": "50" },
									{ "value": "Approved", "icon": "mdi mdi-file-upload", "badge": "35" },
									{ "value": "Rejected", "icon": "mdi mdi-file-upload", "badge": "10" },
									{ "value": "Settled", "icon": "mdi mdi-file-upload", "badge": "99" }
								]
							}
						},
						{
							"value": "Clients",
							"icon": "mdi mdi-account-supervisor-circle",
							"submenu": [
								{ "value": "Add", "icon": "mdi mdi-account-plus" },
								{ "value": "Search", "icon": "mdi mdi-account-search" },
								{ "value": "Broadcast", "icon": "mdi mdi-account-off" }
							]
						},
						{
							"value": "Broker",
							"icon": "mdi mdi-account-details",
							"submenu": [
								{ "value": "Add", "icon": "mdi mdi-account-plus" },
								{ "value": "Search", "icon": "mdi mdi-account-search" },
								{ "$template": "Separator" },
								{ "value": "Broadcast", "icon": "mdi mdi-account-off" },
								{ "$template": "Separator" },
								{ "value": "Unpaid", "icon": "mdi mdi-file-upload" }
							]
						}
					],
					"type": { "subsign": true },
					"height": 0
				},
				{ "view": "label", "label": "SuperCredit ", "align": "right", "height": 0 }
			]
		},
		{
			"cols": [
				{
					"rows": [
						{ "label": "Staff and Brokers", "view": "label", "height": 38 },
						{ 
							"view": "list", 
							"height": 0,
							"template" :"#value#",
							"url" : "data/staff.json"
						},
						{ "label": "Performance Summary", "view": "label", "height": 38 },
						{
							"url": "data/chart.json",
							"type": "pie3D",
							"xAxis": "#value#",
							"yAxis": {},
							"view": "chart",
							"height": 229
						}
					],
					"width": 248
				},
				{
					"width":0 ,
					"rows" : [
						{
							"view": "datatable",
							"columns": [
								{ "id": "funder", "header": "Funder", "fillspace": true, "sort": "string" },
								{ "id": "customer", "header": "Customers", "sort": "string", "width": 200 },
								{ "id": "settlement", "header": "Settlement date", "sort": "string" },
								{ "id": "loanamount", "header": "Loan Amount", "sort": "string" },
								{
									"id": "commission",
									"header": "Commission Margin",
									"sort": "string",
									"width": 200,
									"fillspace": false,
									"hidden": false,
									"css": "{'text-align':'center'}"
								},
								{
									"id": "net",
									"header": "Net Amount",
									"sort": "string",
									"width": 150,
									"fillspace": false,
									"hidden": false
								},
								{ "id": "gst", "header": "GST", "fillspace": false, "hidden": false },
								{ "id": "gross", "header": "Gross Amount", "fillspace": false, "hidden": false },
								{ "id": "pay2broker", "header": "Pay to Broker", "width": 200, "fillspace": false, "hidden": false }
							],
							"select": true,
							"scrollX": false,
							"url" : "data/loan.json",
							"width": 0
						},
						{
							"view": "datatable",
							"sort": false,
							"scroll" : false, 
							"columns": [
								{ "id": "funder", "header": "", "fillspace": true, "sort": "string" },
								{ "id": "customer", "header": "", "sort": "string", "width": 200 },
								{ "id": "settlement", "header": " ", "sort": "string" },
								{ "id": "loanamount", "header": " ", "sort": "string" },
								{
									"id": "commission",
									"header": " ",
									"sort": "string",
									"width": 200,
									"fillspace": false,
									"hidden": false,
									"css": "{'text-align':'center'}"
								},
								{
									"id": "net",
									"header": " ",
									"sort": "string",
									"width": 100,
									"fillspace": false,
									"hidden": false
								},
								{ "id": "gst", "header": "", "fillspace": false, "hidden": false },
								{ "id": "gross", "header": "", "fillspace": false, "hidden": false },
								{ "id": "pay2broker", "header": "Total", "width": 200, "fillspace": false, "hidden": false }
							],							
							"height": 100,
							"url" : "data/loan_total.json"
						}
					]
				},

			]
		}
	]
};
webix.ui(dashboard);