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

cannot call method center of undefined.

2 Answers 88 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chrys
Top achievements
Rank 1
Chrys asked on 28 Mar 2013, 02:33 PM
I have this grid set up.
@model IEnumerable<MyDllClass.Account>
 
@{
    ViewBag.Title = "User Management";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
 
@(Html.Kendo().Grid(Model)
.Name("UsersGrid")
.Columns(columns =>
{
    columns.Bound(currentAccount => currentAccount.FirstName);
    columns.Bound(currentUser => currentUser.LastName);
    columns.Bound(currentUser => currentUser.Email);
    columns.Bound(currentUser => currentUser.Phone1.PhoneNumber).Title("Primary Phone");
    columns.Bound(currentUser => currentUser.Organization);
    columns.Bound(currentUser => currentUser.Address.County.CountyName);
    columns.Bound(currentUser => currentUser.Role);
    columns.Bound(currentUser => currentUser.IsLocked);
    columns.Bound(currentUser => currentUser.AccountLog.LastLogIn);
    columns.Bound(currentUser => currentUser.IsActive).Title("Enabled");
    columns.Command(command => { command.Edit(); command.Destroy(); }).Width(300);
})
.ToolBar(toolbar => toolbar.Create())
.Editable(editable => editable.Mode(GridEditMode.PopUp).TemplateName("AddEditUser").Window(window => window.Width(750)))
.Pageable(pages => pages.PageSizes(true))
.Sortable()
.DataSource(datasource => datasource
    .Ajax()
    .ServerOperation(true)
    .Model(model => model.Id(currentAccount => currentAccount.UserName))
            .Create(update => update.Action("AddAccount", "Account"))
            .Update(update => update.Action("EditAccount", "Account"))
            .Destroy(update => update.Action("DeletAccount", "Account"))
    )
  )
 
<script type="text/javascript">
    $(document).ready(function () {
        var grid = $('#UsersGrid').data("kendoGrid");
        if (!grid)
            console.log("Nothin");
        else
            grid.bind("edit", function (e) {
 
            });
    });
</script>
When I try to edit or add I get the following jquery/javascript error:
 Uncaught TypeError: Cannot call method 'center' of undefined

2 Answers, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 29 Mar 2013, 10:19 AM
Hi Chrys,

I tried to reproduce the problem locally but to no avail – everything is working as expected on our side. Could you please provide runable project where the issue is reproduced? This would help us pinpoint the exact reason for this behavior.

Kind Regards,
Vladimir Iliev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Accepted
Chrys
Top achievements
Rank 1
answered on 01 Apr 2013, 02:38 PM
Problem was injected some extra javascript files on the editor when I created it as a partial.
Tags
Grid
Asked by
Chrys
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Chrys
Top achievements
Rank 1
Share this question
or