Author Topic: Pager is not visible - PRO  (Read 14695 times)

dbadmin

  • Pro Economy
  • Jr. Member
  • *
  • Posts: 67
    • View Profile
Re: Pager is not visible - PRO
« Reply #15 on: June 17, 2014, 11:03:38 pm »
Oh, I got it now! It shows the pager now, thank you.

So would this be the right way to pass current page to the service VIA $POST?

                          getUrl: function (ui)
              {
                 var pageModel = ui.pageModel;
                 var filters = { "name" : $("#txName").val(),
                             "curPage": pageModel.curPage,
                             "recPerPage": pageModel.rPP,
                                 };
                   return {
                    url: "../services/Search.php",
                     data: { dataBuffer: filters }
                };
            },

I also have a question in regards of totalRecords. I prefer not to calculate total and leave it blank, but then pager misbehaves. Is there a way to handle this situation?

dbadmin

  • Pro Economy
  • Jr. Member
  • *
  • Posts: 67
    • View Profile
Re: Pager is not visible - PRO
« Reply #16 on: June 20, 2014, 03:48:17 am »
Hi,

So could you tell me if this is the right way? I often get current page = 0 and it doesn't seem to be correct.
Also when I change the filtering field (Name) and search again, CurrentPage value is retrieved from a previous search, so it creates a problem when previous search had page 5, and a user was on page 5, but new search only has 3 pages -- a user gets an empty resultset.

Thanks!

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6263
    • View Profile
Re: Pager is not visible - PRO
« Reply #17 on: June 20, 2014, 10:05:04 pm »
That's the right way to send parameters to the server. However the end result in the grid i.e., remote paging and remote filtering is little bit dependent upon on your javascript and more dependent upon how you handle the parameters on the server side. If you write incorrect PHP code, you would get incorrect result in the grid.

The benefit of using paramquery filter method and following the demos is that it takes care of

sending filter parameters on its own
protects against SQL injection attacks.
you can use the already written filterHelper method in PHP.

http://paramquery.com/pro/demos/filter_header
« Last Edit: June 20, 2014, 10:15:28 pm by paramquery »