﻿@Html.Partial("_AccountTypeLinks")

<h2>All Accounts</h2>

<table id="accountsTable" class="table table-bordered table-hover">
  <thead>
    <tr>
      <th>Name</th>
      <th>Type</th>
      <th>Balance</th>
    </tr>
  </thead>
</table>

@section scripts
{
  <script>
    $(document).ready(function() {
      $('#accountsTable').DataTable({
        ajax:
        {
          url: '/api/Core/Account',
          dataSrc: ''
        },
        columns:
        [
          { data: 'Name' },
          { data: 'AccountType.Name' },
          { data: 'Balance' }
        ]
      });
    });
  </script>
}

﻿@Html.Partial("_AccountTypeLinks")

<h2>All Accounts</h2>

<table id="accountsTable" class="table table-bordered table-hover">
  <thead>
    <tr>
      <th>Name</th>
      <th>Type</th>
      <th>Balance</th>
    </tr>
  </thead>
</table>

@section scripts
{
  <script>
    $(document).ready(function() {
      $('#accountsTable').DataTable({
        ajax:
        {
          url: '/api/Core/Account',
          dataSrc: ''
        },
        columns:
        [
          {
            data: 'Name',
            render:
            function (data, type, account) {
              return "<a href='/Core/Account/Edit/" + account.Id + "'>" + data + "</a>";
            }
          },
          { data: 'AccountType.Name' },
          { data: 'Balance' }
        ]
      });
    });
  </script>
}

Edit accounts of 'all' page.
Edit accounts of 'all' page.

