ildar-shaymukhametov_grandnode-refactorings/Grand.Web/Areas/Admin/Views/Shipping/Warehouses.cshtml
@{    
    //page title
    ViewBag.Title = T("Admin.Configuration.Shipping.Warehouses").Text;
}

<div class="row">
    <div class="col-md-12">
        <div class="x_panel light form-fit">
            <div class="x_title">
                <div class="caption">
                    <i class="fa fa-list-alt"></i>
                    @T("Admin.Configuration.Shipping.Warehouses")
                </div>
                <div class="actions btn-group btn-group-devided">
                    <a href="@Url.Action("CreateWarehouse")" class="btn green"><i class="fa fa-plus"></i><span class="d-none d-sm-inline"> @T("Admin.Common.AddNew") </span></a>
                    <vc:admin-widget widget-zone="warehouse_list_buttons" additional-data="null" />
                </div>

            </div>
            <div class="x_content form">
                <div class="form-horizontal">
                    <div class="form-body">
                        <div class="x_content">
                            <div id="warehouse-grid"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    $(document).ready(function () {
        $("#warehouse-grid").kendoGrid({
            dataSource: {
                transport: {
                    read: {
                        url: "@Html.Raw(Url.Action("Warehouses", "Shipping"))",
                        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();
                },
                serverPaging: true,
                serverFiltering: true,
                serverSorting: true
            },
            pageable: {
                refresh: true,
                numeric: false,
                previousNext: false,
                info: false
            },
            editable: {
                confirmation: false,
                mode: "inline"
            },
            scrollable: false,
            columns: [{
                field: "Name",
                title: "@T("Admin.Configuration.Shipping.Warehouses.Fields.Name")",
                template: '<a class="k-link" href="EditWarehouse/#=Id#">#=kendo.htmlEncode(Name)#</a>',
            },
            {
                field: "DisplayOrder",
                title: "@T("Admin.Configuration.Shipping.Warehouses.Fields.DisplayOrder")",
                width: 120,
            }]
        });
    });
</script>