Spreadsheet Create Method Javascript Runtime Error Missing ';' in Kendo.All.JS

3 posts, 0 answers
  1. Jignesh
    Jignesh avatar
    7 posts
    Member since:
    Jul 2017

    Posted 03 Aug 2017 Link to this post

    Record gets in database with response HTTP 200, but getting error in browser. (PFA attachment)

     

    @(Html.Kendo().Spreadsheet()
            .Name("spreadsheet")
            .HtmlAttributes(new { style = "width:100%" })
            .Toolbar(false)
            .Sheetsbar(false)
            .Sheets(sheets =>
            {
                sheets.Add()
                    .Name("Exceptions")
                    .DataSource<C3Connect.C3i.Models.WFM.ExceptionsSpreadsheetVM>(ds => ds
                        .Ajax()
                        .Batch(true)
                        .Read(read => read.Action("SpreadsheetRead", "Exceptions").Data("spreadsheet_additional_data"))
                        .Update("SpreadsheetUpdate", "Exceptions")
                        .Create("SpreadsheetCreate", "Exceptions")
                        .Destroy("SpreadsheetDelete", "Exceptions")
                        .Events(e => e.Change("spreadsheet_onChange").Error("spreadsheet_error"))
                        .Model(m =>
                        {
                            m.Id(p => p.ExceptionID);
                        })
                    )
                    .Columns(columns =>
                    {
                        columns.Add().Width(100);
                        columns.Add().Width(100);
                        columns.Add().Width(100);
                        columns.Add().Width(100);
                        columns.Add().Width(100);
                        columns.Add().Width(100);
                    })
                    .Rows(rows =>
                    {
                        rows.Add().Height(30).Cells(cells =>
                        {
                            cells.Add()
                                .Bold(true)
                                .Background("#9c27b0")
                                .TextAlign(SpreadsheetTextAlign.Center)
                                .Color("white");
     
                            cells.Add()
                                .Bold(true)
                                .Background("#9c27b0")
                                .TextAlign(SpreadsheetTextAlign.Center)
                                .Color("white");
     
                            cells.Add()
                                .Bold(true)
                                .Background("#9c27b0")
                                .TextAlign(SpreadsheetTextAlign.Center)
                                .Color("white");
     
                            cells.Add()
                                .Bold(true)
                                .Background("#9c27b0")
                                .TextAlign(SpreadsheetTextAlign.Center)
                                .Color("white");
     
                            cells.Add()
                                .Bold(true)
                                .Background("#9c27b0")
                                .TextAlign(SpreadsheetTextAlign.Center)
                                .Color("white")
                                .Format("m/d/yyyy h:mm");
     
                            cells.Add()
                                .Bold(true)
                                .Background("#9c27b0")
                                .TextAlign(SpreadsheetTextAlign.Center)
                                .Color("white")
                                .Format("m/d/yyyy h:mm");
                        });
                    });
            })
    )
  2. Joana
    Admin
    Joana avatar
    205 posts

    Posted 04 Aug 2017 Link to this post

    Hi Jignesh,

    I tested a similar configuration of the Kendo Spreadsheet and could not replicate the javascript error. Could you please send us a simple isolated project where we could examine the error? Do you reproduce it without the datasource?

    Regards,
    Joana
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Jignesh
    Jignesh avatar
    7 posts
    Member since:
    Jul 2017

    Posted 14 Aug 2017 Link to this post

    Hi,

    This was resolved by replacing code in Create ActionResult method.

    I was using below code,

    return Json(new[] { exception }.ToDataSourceResult(request, ModelState));

     

    Changed it to below code, returning without array (as described by Telerik Support Team).

    return Json(exceptionsVM.ToDataSourceResult(request, ModelState));
Back to Top