Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- executiveOverviewBuild: function() {
- $.ajax({
- url: "/accounts/feed/",
- async: true,
- dataType: 'json',
- success: function(data) {
- buildAccounts.allAccounts = data;
- $("#main_wrapper").append("<h2 class='text-center announce'>Client Executive Overview - Contract to Date</h2><div class='row'><div class='col-xs-12' id='exec_charts'></div>"
- );
- _.each(data, function(account) {
- $.ajax({
- url: "/accounts/feed/" + account.account_id,
- async: true,
- dataType: 'json',
- success: function(data2) {
- buildAccounts.currentAccount = data2;
- buildAccounts.theMain = data2;
- buildAccounts.mrr = buildAccounts.currentAccount.asset_value;
- /*here*/
- console.log(buildAccounts.currentAccount);
- }
- }).then(function() {
- $.ajax({
- url: "/test/feed/" + buildAccounts.currentAccount.account_id + "/",
- async: true,
- dataType: 'json',
- success: function(data3) {
- /*here*/
- console.log(buildAccounts.currentAccount);
- buildAccounts.accountOldestTicket = data3.oldest_ticket.substring(
- 4, 15);
- buildAccounts.totalHours = data3.total_hours.toString().substr(
- 0, 6);
- }
- });
- }).then(function() {
- $.ajax({
- url: "/test/feed/udf/" + buildAccounts.currentAccount.account_id +
- "/",
- async: true,
- dataType: 'json',
- success: function(data4) {
- buildAccounts.udfs = data4;
- buildAccounts.myChartNumber++;
- $("#exec_charts").append("<canvas id='" + buildAccounts.myChartNumber +
- "' width='350' height='350' class=''></canvas>");
- }
- }).then(function() {
- buildAccounts.createChart();
- });
- });
- });
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement