This is a migrated thread and some comments may be shown as answers.

Grid's k-grid-content div renders twice

0 Answers 226 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jark Monster
Top achievements
Rank 1
Jark Monster asked on 26 Jul 2012, 07:22 PM
The entire grid doesn't render twice.  Just the content div.  Also, the second content div contains an ajax loader that never goes away (See attached image).

Not sure what I'm doing incorrectly.  I've tried removing the grid from the Panel Bar, but it hasn't made any difference yet. 

I'm not sure if it's a library thing or some configuration issue.  I had typed everything in plain jQuery, and that worked, but I have recently switched over to this format because I found it easier to write.

Info:
Kendo UI Version: kendoui.web.2012.2.710
Browser: Firefox - v15.0
OS: Windows 7
jQuery: Same version packaged with Kendo UI download

Thanks in advance!

@model Company.Domain.MVC.Models.ShipmentModel
@using Kendo.Mvc.UI
@{
    Layout = "~/Views/Shared/_StandardLayout.cshtml";
    ViewBag.Title = "Home";
}
 
<script type="text/javascript">
    function QuoteItemGrid_ErrorHandler(e) {
        if (e.errors) {
            var message = "Errors:\n";
            $.each(e.errors, function (key, value) {
                if ('errors' in value) {
                    $.each(value.errors, function () {
                        message += this + "\n";
                    });
                }
            });
            alert(message);
        }
    }
</script>
 
<div id="ShipmentForm">
    @(Html.Kendo().PanelBar()
        .Name("panelBar")
        .ExpandMode(PanelBarExpandMode.Single)
        .HtmlAttributes(new { style = "width:100%" })
        .Items(panelBar =>
        {
            panelBar.Add().Text("Shipment Items")
                .Expanded(true)
                .Content(@<div>
                    @(Html.Kendo().Grid<Company.Domain.MVC.Models.ItemModel>()
                        .Name("QuoteItemGrid")
                        .Columns(columns =>
                        {
                            columns.Bound(i => i.FreightClass).Width(50);
                            columns.Bound(i => i.Length).Width(50);
                            columns.Bound(i => i.Width).Width(50);
                            columns.Bound(i => i.Height).Width(50);
                            columns.Bound(i => i.DimensionUnitOfMeasure).Width(50);
                            columns.Bound(i => i.QuantityValue).Width(50);
                            columns.Bound(i => i.QuantityUnitOfMeasure).Width(50);
                            columns.Bound(i => i.Weight).Width(50);
                            columns.Bound(i => i.WeightUnitOfMeasure).Width(50);
                            columns.Bound(i => i.NmfcCode).Width(50);
                            columns.Bound(i => i.ItemDescription).Width(50);
                        })
                        .ToolBar(toolbar =>
                        {
                            toolbar.Create();
                            toolbar.Save();
                        })
                        .Editable(editable => editable.Mode(GridEditMode.InCell))
                        .Pageable()
                        .Sortable()
                        .Scrollable()
                        .DataSource(dataSource => dataSource
                            .Ajax()
                            .Batch(true)
                            .ServerOperation(false)
                            .Events(events => events.Error("QuoteItemGrid_ErrorHandler"))
                            .Model(model => model.Id(i => i.ItemID))
                            .Create(create => create.Action("CreateProducts", "Home"))
                            .Read(read => read.Action("GetProducts", "Home"))
                            .Update(update => update.Action("UpdateProducts", "Home"))
                            .Destroy(destroy => destroy.Action("DeleteProducts", "Home"))
                        )
                    )
                </div>);
         
            panelBar.Add().Text("Services")
                .Content(@<div>Services here</div>);
         
            panelBar.Add().Text("Address Information")
                .Content(@<div style="margin-left:1%;">
                   HTML omitted for brevity
                </div>);
 
            panelBar.Add().Text("Miscellaneous")
                .Content(@<div>
                    HTML omitted for brevity
                </div>);
        })
    )
</div>

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Jark Monster
Top achievements
Rank 1
Share this question
or