⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Flexigrid - Displaying NaN to NaN of 42 items



velsankar
  • profile picture
  • Member

Posted 21 November 2013 - 13:57 PM

Hi,

 

My mysql query results in 42 items. With grocerycrud, I am using Flexigrid theme and it displays 25 items in page 1. When I click next page button, it does not take to the next page.  Also it displays "Page 1 of NaN" and "Displaying NaN to NaN of 42 items" in the paging bar. Please see image attached.

 

When I try searching for the missing rows using the search filter, it gets displayed.  So all the 42 items are actually coming from the server.  What is going wrong with the Flexigrid pagination?

 

This issue is found in all browsers.

 


Amit Shah
  • profile picture
  • Member

Posted 22 November 2013 - 07:59 AM

Hi velsankar

 

It will be great if you could have shared your code that is causing the trouble.

Secondly i will recommend you using something called - firebug with forefox ... there u can enable the console view and reload the page again in firefox .. in console you should be able to see the ajax calls being made by the application. There you should be able to view the output.. if there is any sort of error / warning it is spitting out, do take a screengrab of the same and share it here so someone can give you resolution on the same. Else you yourself can workaround to get a solutuon on the same.

 

Happy GCing :)


velsankar
  • profile picture
  • Member

Posted 25 November 2013 - 13:23 PM

Hi Amit,

 

Thank you so much for the response.

 

I am just using grocerycrud flexigrid theme and have not modified anything in the library.  So codewise there is nothing specific that I can share. 

 

When the list is loaded, there are two ajax requests. First one gets a response {"total_results" : 42} and the second one gets a response with the actual html for displaying only 25 results.  If I click the next button or last button in paging, the same requests are repeated and resulting in the same response rather than sending the remaining/next results.

 

Please have a look at the screenshot attached.

 


Robert
  • profile picture
  • Member

Posted 26 November 2013 - 06:41 AM

Can you post you controller and db structure ? the problem is there ...


velsankar
  • profile picture
  • Member

Posted 26 November 2013 - 11:07 AM

Hi Robert,

 

Thank you for the response.

 

If I just change the theme to "datatable", the pagination works properly.  This means the problem is not in controller or db and is somewhere within the "flexigrid" theme right?


Robert
  • profile picture
  • Member

Posted 26 November 2013 - 11:57 AM

I have used only flexigrid and there is no problem with the template .. try using a basic example of flexigrid and see if it works

function my_boss_is_in_a_hurry()
{
    $crud = new grocery_CRUD();
    $crud->set_table('customers');
    $crud->columns('customerName','phone','addressLine1','creditLimit');
 
    $output = $crud->render();
 
    $this->_example_output($output);
}

This is from the examples jest change the db name and columns


Amit Shah
  • profile picture
  • Member

Posted 28 November 2013 - 09:16 AM

Hi there,

 

Well me too am a flexgrid user rather then datatables theme user - and i too never faced any such issue. Still if you kind enough to share the piece of code .. we might be in a position to help out .. and look at and where the issue may arise.