We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Getting "cloneArray is not defined" while defining a grid with AddNew column.

I've a simple grid.
I added AddNew feature to the toolbar.


<div  id="grid"style="width:100%;">
    @(Html.Syncfusion().Grid<TestSyncfusion.Models.EntityModel.Item>("Frozen")
                .Datasource((IEnumerable<TestSyncfusion.Models.EntityModel.Item>)ViewData["gridData"])
                .Caption("Orders")
                .AutoFormat(Skins.Marble)
                .PageSettings(settings => settings.PageSize(15).PageCount(10))
                .ActionMode(ActionMode.JSON)
                .Column(columns =>
                {
                    columns.Add(p => p.ID);
                    columns.Add(p => p.ItemID);
                    columns.Add(p => p.CategoryID);
                    columns.Add(p => p.ItemName);
                    columns.Add(p => p.Type);
                })
                .ToolBar(tools =>
                                                     {
                                                         tools.Add(GridToolBarItems.AddNew);
                                                     })
         
                .Editing(edit =>
                                            {

                                                edit.AllowNew(true, "GridAddNewRow/AddItem");
                                                edit.PrimaryKey(key => key.Add(p => p.ID)); 
                                            })

                )
</div>


My controller looks like this:

public class GridAddNewRowController : Controller
    {
        //
        // GET: /GridAddNewRow/

        public ActionResult GridAddNewRow()
        {
            DebtSettlementEntities entities = new DebtSettlementEntities();
            var items = entities.Items.ToList();
            ViewData["gridData"] = items;
            return View();
        }

        [AcceptVerbs(HttpVerbs.Post)]
        public ActionResult GridAddNewRow(PagingParams args)
        {
            IEnumerable data = new DebtSettlementEntities().Items.ToList();
            ActionResult result = data.GridJSONActions<Item>();
            return result;

        }

        [AcceptVerbs(HttpVerbs.Post)]
        public ActionResult AddItem(Item item)
        {
            DebtSettlementEntities en = new DebtSettlementEntities();
            en.Items.AddObject(item);
            en.SaveChanges();

            IEnumerable data = new DebtSettlementEntities().Items.ToList();
            ActionResult result = data.GridJSONActions<Item>();
            return result;

        }

    }

But when I click on AddNew button on the toolbar I get the following error.

  1. Uncaught ReferenceError: cloneArray is not defined
    1. (anonymous function)
    2. (anonymous function)MvcResourceHandler.axd:1
    3. Syncfusion.Mvc.Grid.JSONMode._AddActionMvcResourceHandler.axd:1
    4. Syncfusion.Mvc.Grid.GridControl.ToolbarSwitchOperationMvcResourceHandler.axd:1
    5. Syncfusion.Mvc.Grid.GridControl._toolbarClickHanderMvcResourceHandler.axd:1
    6. (anonymous function)MicrosoftAjax.js:5
    7. (anonymous function)MicrosoftAjax.js:5
    8. Syncfusion.Mvc.Tools.Toolbar._ClickHandlerMvcResourceHandler.axd:1
    9. (anonymous function)MicrosoftAjax.js:5
    10. k.handle.m



      Please help.

1 Reply

ES Eswari S Syncfusion Team May 17, 2013 08:36 AM UTC

Hi Kedar,

 

Thank you for using Syncfusion products.

 

The reported issue with ’ Kedar Kodlapur Getting "cloneArray is not defined" while defining a grid with AddNew column in JSON mode”

 has been confirmed as a defect; and we have already fixed the issue. However, we do not provide confidential information and patches in the general forum, so could you please create a new incident such that we can provide the patch for you.

 

Please let us know if you have any queries.

 

Regards,

Eswari S


Loader.
Live Chat Icon For mobile
Up arrow icon