Infinite scrolling

4 posts, 0 answers
  1. Shakil
    Shakil avatar
    7 posts
    Member since:
    May 2014

    Posted 29 Dec 2014 Link to this post

    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));

            }
        }
  2. Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 30 Dec 2014 Link to this post

    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.

     
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Shakil
    Shakil avatar
    7 posts
    Member since:
    May 2014

    Posted 03 Jan 2015 in reply to Petyo Link to this post

    @(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



  5. Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 03 Jan 2015 Link to this post

    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.

     
Back to Top
UI for ASP.NET MVC is VS 2017 Ready