ildar-shaymukhametov_grandnode-refactorings/Grand.Web/Areas/Admin/Views/Shared/Components/OrderBestsellersBriefReportByAmount/Default.cshtml
@{
    var gridPageSize = 5;
}
<div id="bestsellers-byamount-grid"></div>
<script>
    $(document).ready(function () {
        $("#bestsellers-byamount-grid").kendoGrid({
            dataSource: {
                transport: {
                    read: {
                        url: "@Html.Raw(Url.Action("BestsellersBriefReportByAmountList", "Reports"))",
                        type: "POST",
                        dataType: "json",
                        data: addAntiForgeryToken
                    }
                },
                schema: {
                    data: "Data",
                    total: "Total",
                    errors: "Errors"
                },
                error: function(e) {
                    display_kendoui_grid_error(e);
                    // Cancel the changes
                    this.cancelChanges();
                },
                pageSize: @(gridPageSize),
                serverPaging: true,
                serverFiltering: true,
                serverSorting: true
            },
            pageable: {
                refresh: true
            },
            editable: {
                confirmation: false,
                mode: "inline"
            },
            scrollable: false,
            columns: [{
                field: "ProductName",
                title: "@T("Admin.Reports.Bestsellers.Fields.Name")",
                template: '<a class="k-link" href="@Url.Action("Edit", "Product")/#=ProductId#">#=ProductName#</a>',
            }, {
                field: "TotalQuantity",
                title: "@T("Admin.Reports.Bestsellers.Fields.TotalQuantity")"
            }, {
                field: "TotalAmount",
                title: "@T("Admin.Reports.Bestsellers.Fields.TotalAmount")"
            }]
        });
    });
</script>
