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

Help with Listview READ action not fired in umbraco7 MVC

6 Answers 82 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Pierre
Top achievements
Rank 2
Iron
Iron
Pierre asked on 07 Nov 2014, 02:44 PM
Hi, i try several thing to make my listview working without success. I do not see any error in console, but the initial "get" request not fired. I can't see where a make a mistake..

My js definition:
<script src="~/LibsExt/jquery-1.11.0.min.js"></script>
<script src="~/LibsExt/bootstrap.min.js"></script>
<script src="~/LibsExt/kendo.web.min.js"></script>
<script src="~/LibsExt/kendo.aspnetmvc.min.js"></script>

My Controler (in the action function I do nothing for now. I just when to test if my breakpoint will be hit.
public ActionResult Produits_Read([DataSourceRequest] DataSourceRequest request)
{
    int i = 0;
    return Json("");
}

my model
public class ProduitModel
{
    public int id { get; set; }
    public string Nom { get; set; }
    public string urlThumb { get; set; }
    public string urlImage { get; set; }
    public string descCourte { get; set; }
    public IHtmlString contenu { get; set; }
    public decimal prix { get; set; }
}

Then my view
@(Html.Kendo().ListView<ProduitModel>(@Model.produits)
    .Name("listView")
    .TagName("div")
    .ClientTemplateId("produitTemp")
    .DataSource(dataSource => {
        dataSource.Read(read => read.Action("Produits_Read","CategoriesController").Type(HttpVerbs.Get));
        dataSource.PageSize(15);
    })
    .Pageable()
    .BindTo((IEnumerable<ProduitModel>)ViewData["listView"])
)

I try with or without the .BindTo command with same result.
What are missing?
I am running in umbraco7 MVC 4 environnement. meaby is the point? Need to add something there in routing or config?
Thanks a lot

6 Answers, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 11 Nov 2014, 02:39 PM
Hello Pierre-Dominique,

I can see that you are binding your ListView in a few places. Please test the following configuration:

@(Html.Kendo().ListView<ProduitModel>()
    .Name("listView")
    .TagName("div")
    .ClientTemplateId("produitTemp")
    .DataSource(dataSource => {
        dataSource.Read(read => read.Action("Produits_Read","CategoriesController"));
        dataSource.PageSize(15);
    })
    .Pageable()
)

If this does not help please examine for any JavaScript errors in the console, as it might be another cause for issues.

Regards,
Kiril Nikolov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Pierre
Top achievements
Rank 2
Iron
Iron
answered on 26 Nov 2014, 08:46 PM
Sory for late reply. I try your code. Same result. I can't see any error in cosole...
0
Pierre
Top achievements
Rank 2
Iron
Iron
answered on 26 Nov 2014, 08:48 PM
And i see no server call in the network console of chrome.
0
Kiril Nikolov
Telerik team
answered on 27 Nov 2014, 03:00 PM
Hello Pierre-Dominique,

Can you please send us an example that shows your exact setup so we can run it locally and narrow down the issue?

Thanks for the cooperation.

Regards,
Kiril Nikolov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Pierre
Top achievements
Rank 2
Iron
Iron
answered on 02 Dec 2014, 03:59 PM
Hi, i Just try to start with the Telerik MVC Template, than add the listview in the About page, add the Template, add the model and add the action code in the HomeController.
No error, but then action code not fired. I am new to MVC programmaing, I am shure i do something wrong. If you can point it to me?
Thanks a lot
I can't attache the file (more than 2 Meg).

Here what I do:
1- Create an empty Telerik MVC app (MVC5)
2- Add this in the about view
<aside>
    <h3>Telerik UI for ASP.NET MVC TreeView</h3>
    <p>
        Use this area to provide additional information.
    </p>
 
    <div class="ListeProduits">
        @(Html.Kendo().ListView<TelerikMvcApp1.Models.ProduitModel>()
        .Name("listView")
        .TagName("div")
        .ClientTemplateId("produitTemp")
        .DataSource(dataSource =>
        {
 
            dataSource.Read(read => read.Action("Produits_Read", "HomeController"));
 
            dataSource.PageSize(15);
 
        })
        .Pageable()
        )
    </div>
 
    @(Html.Kendo().TreeView()
        .Name("LinksTreeView")
        .Items(items =>
        {
            items.Add()
                .Text("Home")
                .Action("Index", "Home");
            items.Add()
                .Text("About")
                .Action("About", "Home");
            items.Add()
                .Text("Contact")
                .Action("Contact", "Home");
        })
    )
 
</aside>

3- add this model
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
 
namespace TelerikMvcApp1.Models
{
    public class ProduitModel
    {
        public int id { get; set; }
        public string Nom { get; set; }
        public string urlThumb { get; set; }
        public string urlImage { get; set; }
        public string descCourte { get; set; }
        public IHtmlString contenu { get; set; }
        public decimal prix { get; set; }
    }
}

4- Add this in the HomeControler
public ActionResult Produits_Read([DataSourceRequest] DataSourceRequest request)
{
    int i = 0;
    return Json("");
}

5- Breakpoint on the int i = 0; never fired.
Thanks
0
Kiril Nikolov
Telerik team
answered on 03 Dec 2014, 12:51 PM
Hello Pierre-Dominique,

Please make sure that you do not have any JavaScript errors in the console, and the template is correctly compiled, if you have error in the ClientTempalte (can be seen in the console of your Chrome dev tools) no request will be made. Other possible reason is missing kendo.aspnetmvc.min.js file, please make sure that it is included in the project.

If this does not help, send us the sample, so we can investigate the issue.

Regards,
Kiril Nikolov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
ListView
Asked by
Pierre
Top achievements
Rank 2
Iron
Iron
Answers by
Kiril Nikolov
Telerik team
Pierre
Top achievements
Rank 2
Iron
Iron
Share this question
or