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

[Solved] Paging on Scroll

11 Answers 107 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Julien
Top achievements
Rank 1
Julien asked on 14 Dec 2011, 03:53 PM
Hi,

I'm testing some of your features.

I've the AdventureWorks database, I wish to display all employees in a grid, loading next employee on next scroll.

I tried to reproduce this: http://demos.telerik.com/aspnet-mvc/razor/grid/pageonscroll

But it doesn't work here:

@model IEnumerable<MvcTestApplication.Models.Employee>
         
@{
    ViewBag.Title = "Index";
}
@{
     
    Html.Telerik().Grid(Model)
        .Name("Grid")
        .Columns(columns =>
        {
            columns.Bound(o => o.ContactID);
            columns.Bound(o => o.Contact.FirstName);
            columns.Bound(o => o.Contact.LastName);
            columns.Bound(o => o.BirthDate).Format("{0:dd.MM.yyyy}");
        })
        .DataBinding(dataBinding => dataBinding.Ajax().Select("_PageOnScroll", "Employee"))
        .Pageable(paging => paging.Style(GridPagerStyles.Status).PageOnScroll(true))       
        .Render();
         
}


And I've in the controller
private AdventureWorksEntities db = new AdventureWorksEntities();
 
        //
        // GET: /Employee/
 
        public ViewResult Index()
        {
            List<Employee> employeesWithoutCircular = GetEmployeesWithoutCircular();
            return View(employeesWithoutCircular);
        }
        [GridAction]
        public ActionResult _PageOnScroll()
        {
            return View(new GridModel<Employee>
            {
                Data = GetEmployeesWithoutCircular()
            });
        }
        private List<Employee> GetEmployeesWithoutCircular()
        {
            List<Employee> employeesWithoutCircular = new List<Employee>();
            foreach (Employee employee in db.Employees.Include("Contact"))
            {
                Employee emp = new Employee {BirthDate = employee.BirthDate, ContactID = employee.ContactID};
                emp.Contact = new Contact() {FirstName = employee.Contact.FirstName, LastName = employee.Contact.LastName,};
                emp.Contact.Employees = null;
                employeesWithoutCircular.Add(emp);
            }
            return employeesWithoutCircular;
        }

The first load is done, I've the 10 first results displayed, but after that, when i reach the end of the scroll, I don't even see any ajax call on the console of my browser(chrome).

The application is a empty default telerik MVC application, I just created this controller and this view in addition, and added a POCO entity.

I can't find the difference with your sample. I don't have any exception throwed., client or server side.

11 Answers, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 15 Dec 2011, 01:06 PM
Hello Julien,

I am afraid that I also don't se what might be the reason for this behavior. Does the server returns next page data when you scroll to the bottom of the grid?

Greetings,
Nikolay Rusev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Julien
Top achievements
Rank 1
answered on 15 Dec 2011, 01:11 PM
No, I've no ajax request going to the server and nothing is changing
0
Nikolay Rusev
Telerik team
answered on 16 Dec 2011, 09:16 AM
Hello Julien,

Can you please send us runnable app that demonstrates this behavior in order to assist you further?

All the best,
Nikolay Rusev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Julien
Top achievements
Rank 1
answered on 19 Dec 2011, 08:20 AM
Sure, I was only testing this feature, so its easy, you can download it at http://dl.dropbox.com/u/368403/Telerik/MvcTestApp.zip

The form is on the http://localhost:51235/Employee

It use the AdventureWorks database to test, which I think you should have(I got it with your reporting product)
0
Nikolay Rusev
Telerik team
answered on 19 Dec 2011, 09:42 AM
Hello Julien,

It seems that the projet works on my end. Check the video bellow:
http://screencast.com/t/aQ6XaLk8Qf0

Regards,
Nikolay Rusev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Julien
Top achievements
Rank 1
answered on 19 Dec 2011, 11:55 AM
What could make it works on your workstation and not on mine?
Because it doesn't work here(the only change is that I set the ContactId correctly, but the problem was already present before)
http://screencast.com/t/rMcbHkxVMCKQ

I've the last version(Q3 2011) of asp.net MVC. Are you using the VS debug server?
0
Nikolay Rusev
Telerik team
answered on 19 Dec 2011, 12:48 PM
Hello Julien,

All I did is to change the connection string for the AdventureWorks database in the web.config. Nothing else.

Regards,
Nikolay Rusev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Julien
Top achievements
Rank 1
answered on 19 Dec 2011, 01:01 PM
I did some tests:

In facts it works here on IE, Firefox, but not on chrome.

I disactivated all components of chrome, same problem. It's the last version. 

The sort seems to work on chrome?
0
Nikolay Rusev
Telerik team
answered on 19 Dec 2011, 01:37 PM
Hello Julien,

I am also using the latest version of Chrome(16.0.912.63 m) and as you can see from the video it works as expected.

Are there any JavaScript errors while scrolling the grid? I wasn't able to see the console while scrolling.

All the best,
Nikolay Rusev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Julien
Top achievements
Rank 1
answered on 19 Dec 2011, 01:48 PM
I checked for JS error, but I don't have any.

I was currently testing with the 15.0.874.121 m. When going to the about panel it checked for new update and installed the last version(16.0.912.63 m), and now.... it still don't work :(.

I can't understand why this isn't working
0
Nikolay Rusev
Telerik team
answered on 20 Dec 2011, 09:35 AM
Hello Julien,

Unfortunately I am not able to see why it doesn't work on your side. Can you please test it on other machines to see whether it makes any difference?

Regards,
Nikolay Rusev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
Tags
Grid
Asked by
Julien
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Julien
Top achievements
Rank 1
Share this question
or