@model GiftCardModel
<div class="card-body">
    @await Html.PartialAsync("Table", new DataTablesModel
    {
        Name = "usagehistory-grid",
        UrlRead = new DataUrl("UsageHistoryList", "GiftCard", new RouteValueDictionary { [nameof(Model.GiftCardUsageHistorySearchModel.GiftCardId)] = Model.GiftCardUsageHistorySearchModel.GiftCardId }),
        Length = Model.GiftCardUsageHistorySearchModel.PageSize,
        LengthMenu = Model.GiftCardUsageHistorySearchModel.AvailablePageSizes,
        ColumnCollection = new List<ColumnProperty>
        {
            new ColumnProperty(nameof(GiftCardUsageHistoryModel.CreatedOn))
            {
                Title = T("Admin.GiftCards.History.CreatedOn").Text,
                Width = "200",
                Render = new RenderDate()
            },
            new ColumnProperty(nameof(GiftCardUsageHistoryModel.OrderId))
            {
                Title = T("Admin.GiftCards.History.CustomOrderNumber").Text,
                Width = "200",
                ClassName =  NopColumnClassDefaults.Button,
                Render = new RenderCustom("renderColumnOrderNumber")
            },
            new ColumnProperty(nameof(GiftCardUsageHistoryModel.UsedValue))
            {
                Title = T("Admin.GiftCards.History.UsedValue").Text,
                Width = "200"
            }
        }
    })
    <script asp-location="Footer">
        function renderColumnOrderNumber(data, type, row, meta) {
            var textRenderer = $.fn.dataTable.render.text().display;
            return '<a class="btn btn-default" href="@Url.Content("~/Admin/Order/Edit/")' + row.OrderId + '"><i class="far fa-eye"></i>' + textRenderer(row.CustomOrderNumber) + ' - @T("Admin.Common.View").Text</a>';
        }
    </script>
</div>
