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

Infinite scrolling

3 Answers 235 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Shakil
Top achievements
Rank 1
Shakil asked on 29 Dec 2014, 01:28 PM
hi, these are  my codes for infinite scrolling but its not working .
i posted the code please check and i also debug the code but my action also  not running ..

i provided the code below please check...



@(Html.Kendo().MobileView()
       .Title("Scroll down to load")       
       .Content(obj =>          
            Html.Kendo().MobileListView<TelerikMvcApp5.ShoppingModel.PRODUCT_IMAGE>()
                .Name("endless-scrolling")
                .TemplateId("template")
                .EndlessScroll(true)                    
                .ScrollTreshold(30)
                .DataSource(dataSource =>
                    dataSource
                        .Read("Scroll", "Image")
                        .PageSize(20)                            
                )
        )   
)

<script type="text/x-kendo-tmpl" id="template">
    <div class="product">
        <img src="#=IMAGENAME#" alt="image" class="pullImage"/>
   
    </div>
</script>

<style scoped>
    .product h3 {
        font-size: 1.3em;
        font-weight: normal;
        line-height: 1.4em;
        margin: 0;
        padding: .5em 0 0;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
    .product p {
        font-size: 1em;
        margin: 0;
        padding: .3em 0 0;
    }
    .pullImage {
        width: 64px;
        height: 64px;
        border-radius: 3px;
        float: left;
        margin-right: 1em;
    }
</style>


This is my action with controller

public class ImageController : Controller
    {
        ShoppingEntities db = new ShoppingEntities();
        //
        // GET: /Image/
        public ActionResult Index()
        {
            return View();
        }


[AcceptVerbs(HttpVerbs.Post)]

    public ActionResultScroll([DataSourceRequest] DataSourceRequest request)
        {

            var list = db.PRODUCT_IMAGE.ToList();
            return Json(list.ToDataSourceResult(request));

        }
    }

3 Answers, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 30 Dec 2014, 01:02 PM
Hello Shakil,

the page size of your datasource is too small. Try increasing it. 

Regards,
Petyo
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
Shakil
Top achievements
Rank 1
answered on 03 Jan 2015, 06:41 AM
@(Html.Kendo().MobileView()
.Title("Scroll down to load")
.Content(obj =>
Html.Kendo().MobileListView<Kendo.Mvc.Examples.Models.ProductViewModel>()
.Name("endless-scrolling")
.TemplateId("template")
.EndlessScroll(true)
.ScrollTreshold(30)
.DataSource(dataSource =>
dataSource
.Read("Scroll_Read", "Mobile_ListView")
.PageSize(20)
)
)
) This is demo code. Given by you. I want to purchase telerik control for mvc but i think it is less customized so please provide me proper solution. Thanks



0
Petyo
Telerik team
answered on 03 Jan 2015, 05:08 PM
Hi,

You can read more about the page size value and its relation to the endless scrolling mode in our documentation. If increasing the page size did not resolve the issue you are facing, I am not sure what else it is, since you have not provided any further information about the nature of problem you face. Please try isolating it in a sample runnable project.
 

Regards,
Petyo
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
Shakil
Top achievements
Rank 1
Answers by
Petyo
Telerik team
Shakil
Top achievements
Rank 1
Share this question
or