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:
My Controler (in the action function I do nothing for now. I just when to test if my breakpoint will be hit.
my model
Then my view
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
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
0
Hello Pierre-Dominique,
I can see that you are binding your ListView in a few places. Please test the following configuration:
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
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
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
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
3- add this model
4- Add this in the HomeControler
5- Breakpoint on the int i = 0; never fired.
Thanks
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
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
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.