CodeIgniter JQXWIDGETS - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: CodeIgniter JQXWIDGETS (/showthread.php?tid=69812) |
CodeIgniter JQXWIDGETS - danangeloalcanar - 01-20-2018 Hello Community, Has anyone tried using jqwidgets grid? I am using this for a server side paging. I am retrieving a large data from database so I need to user paging. I have followed the tutorials on their website, and able to make it work. But only the pagesize. When i change the pagesize, it refreshes and pull out data from the database. Let say I selected 100, the grid will refresh and fetch 100 records from the database. But the problem is in the pagenum. When I click the next or previous button, it seems that is not passing anything to the server. Would you help me with this? I appreciate it so much. Let me show you my code. // Controller: PHP Code: public function fetchCustomers() { // MODEL PHP Code: public function fetchCustomers($pagenum, $pagesize) { // JAVASCRIPT Code: $(document).ready(function() { // SQL QUERY Code: ALTER procedure [dbo].[fetchCustomers] Sending thanks from Philippines - DAN RE: CodeIgniter JQXWIDGETS - jreklund - 01-20-2018 As far I can see you never include pagesize or pagenum in your Ajax. Look at the Network tab in your Browsers Dev tools. And look at the data you actually sends to your server every time you press a number. RE: CodeIgniter JQXWIDGETS - danangeloalcanar - 01-20-2018 (01-20-2018, 06:40 AM)jreklund Wrote: As far I can see you never include pagesize or pagenum in your Ajax. Hi jreklund, yes i have already did that I checked the data passed on network tabs. What I know is that jqwidgets passes pagenum for me. I mean i dont have to define it in my code. Am not sure though. When I change the pagesize it is retrieving records from the server. But if i clicked the next button nothing is happening. Thankyou.. RE: CodeIgniter JQXWIDGETS - dave friend - 01-20-2018 I think you need a handler in your javascript to respond to the next and previous buttons clicks i.e Code: $("#customers").on("pagechanged", function (event) { See this jsFiddle for an example. RE: CodeIgniter JQXWIDGETS - danangeloalcanar - 01-20-2018 Hi, Thank you for your suggestions, it makes me see what I might be doing wrong. The problem is on my SQL query. It is not getting all the results. It just gets the results with the limit and offset applied. Here is my new query. Hope it helps someone: Code: SELECT RE: CodeIgniter JQXWIDGETS - axelkefas - 08-20-2018 Where you put your SQL Query in codeigniter? RE: CodeIgniter JQXWIDGETS - php_rocs - 08-20-2018 @danangeloalcanar, By any chance do you test your SQL in MySQL Workbench (or any other MySQL tool)? This would help you to determine how effective your query is. |