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

ListView Server-Side Validation

1 Answer 86 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Aaron
Top achievements
Rank 1
Aaron asked on 10 Jan 2017, 08:42 PM

I currently have a ListView that I'm using to update database entries.  I'm not getting any of the ModelState errors to display upon update.  This is my main issue.

After reviewing the related tickets here, the solution seemed fairly simply.  However, I'm having some issues, here is my ListView

@(Html.Kendo().ListView<OrderEntry.Models.OrderEntry.Product>()
                    .Name("ListView")
                    .TagName("div")
                    .ClientTemplateId("template")
                    .DataSource(dataSource => dataSource
                        .Model(model => model.Id(p => p.OrderID))
                        .PageSize(1)
                        .Read(read => read.Action("ProductReadAll", "Order", new { associatedOrderID =       ViewBag.AssociatedOrderID }))
                        .Create(create => create.Action("ProductCreate", "OpsOrder"))
                        .Update(update => update.Action("ProductUpdate", "OpsOrder"))
                        .Events(e => e.Error("error"))
                    )
                    .Pageable()
                    .Editable(edit => edit.TemplateName("ProductEdit"))
                )

My issue with this, adding the Error Event is causing an error stating that "error" (the name of whatever js function I use) is not defined in /Order/ProductDetailsRead.  ProductDetailsRead is a method in my controller that is called to show the page this ListView is on.  Why is the ListView looking in my controller for a js function?  Haven't run into anything similar to this anywhere else in our website.

Are there any alternatives to showing modelstate errors when updating an item? Something more similar to grids?

 

 

 

 

 

1 Answer, 1 is accepted

Sort by
0
Angel Petrov
Telerik team
answered on 12 Jan 2017, 02:59 PM
Hello,

I am experiencing difficulties understanding the scenario. Is the ListView not finding the controller action that should be used for updating? In order for us to provide a precise answer on the matter I suggest sharing with us the entire view and controller code. If this is not possible I would kindly like to ask you to open a formal support ticket and attach a small runnable sample that we can debug.

Regards,
Angel Petrov
Telerik by Progress
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.
Tags
ListView
Asked by
Aaron
Top achievements
Rank 1
Answers by
Angel Petrov
Telerik team
Share this question
or