⚠ 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

Firefox does not display data in table



Ralf Hundertmark
  • profile picture
  • Member

Posted 07 October 2012 - 10:18 AM

Hi there,

First of all, I would like to say that I really like GroceryCrud and the ease of use.
I mainly develop using firefox, but now I have the weirdest of situation.

I use GrocercyCrud on a simple mySql table (6 fields, 1 orimary index, <200 rows).

The call to the $crud->render function deliveres the wanted reults (I did a print_r on the return value of render and saw all results).

When I echo the result (the putput variable) in my view, it works as expected in Chrome, Safari, Opera and IE !!!, but not if Firefox?!

FF work just great on the ten DB tables I am managing using GC, but this one just does not want to display.

I extract the JS and CSS like this:
<?php foreach($css_files as $file): ?>
<link type="text/css" rel="stylesheet" href="<?php echo $file; ?>" />
<?php endforeach; ?>

<?php foreach($js_files as $file): ?>
<script src="<?php echo $file; ?>"></script>
<?php endforeach; ?>


When I comment out the the js_files from the rendered result, the table shows, but many other functions are missing.

Did anybody ever encountered that?

Thanks a lot in advance,
Ralf

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 07 October 2012 - 10:27 AM

Hello [member='Ralf Hundertmark'] and welcome to the forum.

This is really a strange reaction. For my testing environment firefox it is my first priority. It is weird why it doesn't work. Can we have a print-screen of your situation?

Please also make sure that your browser is not a BETA version as I don't have tests for beta versions. So make sure that you have the latest version of firefox (15.0.1)

I think if you give us some code of your method in your controller that will help too.

Cheers
Johnny

Ralf Hundertmark
  • profile picture
  • Member

Posted 07 October 2012 - 10:58 AM

Howowowowow, this is a fast reply. Thank you very much indeed :-)

OK here is the code from teh controller:

    public function expenses()
{
$crud = new grocery_CRUD();
if (strlen($this->uri->segment(3)) > 0) {
$crud->where('Pv_no like "'.$this->uri->segment(3).'%"');
} // end if

$crud->order_by('Pv_no');
$crud->limit(100);
$crud->set_table('receipts');
$crud->columns('Pv_no','Date','Description','Amount');
$crud->callback_column('Amount','_callback_format_float');
$crud->set_field_upload('slip_url','assets/uploads/slips');

$data["crud_out"] = $crud->render();


$data["page_class"] = "Budget";
$data["title"] = "Receipts";
$data["main_content"] = "budget/budget_expenses";
$this->load->view('template/template',$data);
}


and this is the view:

<?php

if (isset($page_class)) {

$myClass = $page_class;

}

else {

$myClass = "default";

}

foreach($crud_out as $key=>$value) { ${$key} = $value; }
?>




<div id="main_content">

<?php foreach($css_files as $file): ?>
<link type="text/css" rel="stylesheet" href="<?php echo $file; ?>" />
<?php endforeach; ?>

<?php foreach($js_files as $file): ?>
<script src="<?php echo $file; ?>"></script>
<?php endforeach; ?>


<h1><?php echo( $title); ?> </h1>

<div id="content_pane_type_d" class="shadow">
<?php echo( $output); ?>
<?php // print_r( $crud_out); ?>

</div>
</div>


This is how the result looks in FF:
https://www.sugarsync.com/pf/D8402138_68926270_963135


and the same in chrome
https://www.sugarsync.com/pf/D8402138_68926270_963123


Thanks so much for your help.

Bast regards,
Ralf

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 07 October 2012 - 11:12 AM

Ok I think I know where the problem could be. Do the below changes and probably you will not have any problem:
[b]1. Move the code:[/b]

<?php foreach($css_files as $file): ?>
<link type="text/css" rel="stylesheet" href="<?php echo $file; ?>" />
<?php endforeach; ?>
<?php foreach($js_files as $file): ?>
<script src="<?php echo $file; ?>"></script>
<?php endforeach; ?>

to the head tag. It is not only that it is a bad practice but also you will have many instability problems in the future. I think you where just lucky that until now you didn't have other problems with that. Moreover you will see that your pages will load much faster.

[b]2. Clear your cookies and cache to this webpage[/b].
If you have the web developer add-on for firefox just press those three buttons:

[attachment=307:2012-10-07_120552.png]

In someway you crashed groceryCRUD and the cookies are still there crashing this table. If you just remove the cookies and start again from the beginning it will probably work.

Ralf Hundertmark
  • profile picture
  • Member

Posted 07 October 2012 - 11:20 AM

Dear Jhonny,

Fantastic. That solved it.
Thank you very much indeed.

Cheers,
Ralf