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

Grid Paging UI has gone Mad

4 Answers 55 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Eric
Top achievements
Rank 1
Eric asked on 12 Feb 2013, 10:09 PM
My grid has lost it's mind. Why am I seeing two pager sections? One that seems to work and the other has no idea?

Does any one know how or why this could happen?  Code Below.



View

@(Html.Kendo().Grid<AppointmentsDTO>()

                .Name("divgrid")

                .Columns(columns =>

                {

                    columns.Bound(o => o.MemberFirstName).Title("Member<br/>First Name");

                    columns.Bound(o => o.MemberLastName).Title("Member<br/> Last Name");

                    columns.Bound(o => o.ClientMemberID).Title("Client<br/>MemberID");

                    columns.Bound(o => o.ProviderID).Title("ProviderID");

                    columns.Bound(o => o.ProviderFirstName).Title("Provider<br/> First Name");

                    columns.Bound(o => o.ProviderLastName).Title("Provider<br/> Last Name");

                    columns.Bound(o => o.AppointmentDate).Title("Appointment<br/> Date");

                    columns.Bound(o => o.IHAAppointmentID).Hidden(true);

                })

                .DataSource(dataSource => dataSource

                .Ajax()  

                .Read(read => read.Action("ScheduledAppointments", "AppointmentScheduling")

                .Data("additionalData")

                    //the name of the JavaScript function which will return the additional data

                ))

               .Pageable() 

               .AutoBind(false)   

               .Scrollable()

          )

 JavaScript

$('#btnSearch').click(function () {

        DoSearch();

    });

   

    function DoSearch() {

        var grid = $("#divgrid").data("kendoGrid");

        grid.dataSource.read();       

    }

 

    function additionalData() {

        return {

            beginDate: $("#startDate").val(),

            endDate: $("#finishDate").val()

        };

    }

Controller

[HttpPost]

        public ActionResult ScheduledAppointments([DataSourceRequest]DataSourceRequest request, string beginDate, string endDate)

        {

            //calling service           

            var result = model.AppointmentList.ToDataSourceResult(request);

            JsonResult jresult = GetJsonResult(result, true);

 

            return jresult;

        }

 


4 Answers, 1 is accepted

Sort by
0
Rajiv
Top achievements
Rank 1
answered on 12 Feb 2013, 10:51 PM
Apologize for asking a question on your question but what does <AppointmentsDTO> signify in the below line?
@(Html.Kendo().Grid<AppointmentsDTO>()
Is it a model, view or a controller. Really sorry, but I am trying to learn Kendo.

0
Eric
Top achievements
Rank 1
answered on 13 Feb 2013, 01:04 AM
Its just a class that represents the data in the grid.
0
Petur Subev
Telerik team
answered on 14 Feb 2013, 05:01 PM
Hello Eric,

It sounds like your Grid is initialized two times, however I cannot see any evidences inside your code. Is the Grid inside a Splitter or Window? Or is there something that you missed to mention?

Kind regards,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Eric
Top achievements
Rank 1
answered on 14 Feb 2013, 08:32 PM
The developer told me this morning the problem went away and he does not know why. I have multiple developers all implementing grid controls so my guess is someone figured out that the kendo scripts were in the wrong order.

I think it would have been better if the js files did not conflict with each other.
Tags
Grid
Asked by
Eric
Top achievements
Rank 1
Answers by
Rajiv
Top achievements
Rank 1
Eric
Top achievements
Rank 1
Petur Subev
Telerik team
Share this question
or