Php array not working in Javascript
Ok Heres my problem,
I'm using the Grid control with PHP. Everything was working, but now the grid displays an empty window and I have no idea why.
I have managed to narrow the problem down to the header and cell variables. The do not seem to work with the php functions that create the myHeaders and mycells variable values.
Heres the part of code that is not working,
<script>
var myHeaders = <?php aw_headers($dataset) ?>
var myCells = <?php aw_cells($dataset) ?>
</script>
I have worked this out because if you manually enter the values and the grid works fine.
<script>
var myHeaders = ["Company Name"];
var myCells = [["A1 Moto"]];
</script>
And I know the dataset functions work because if I call the functions inside the php, and display them on the same page, they display the correct data!!
I have changed from Version 2.0 to 2.5, but I have tried using version 2.0 and the same problem persist.
Is it something to do with the opening php statement because it's shown on the forums as
var myHeaders = <?= aw_headers($dataset) ?>
var myCells = <?= aw_cells($dataset) ?>
But when I use <?= this dose not work either!
Help!
I'm using the Grid control with PHP. Everything was working, but now the grid displays an empty window and I have no idea why.
I have managed to narrow the problem down to the header and cell variables. The do not seem to work with the php functions that create the myHeaders and mycells variable values.
Heres the part of code that is not working,
<script>
var myHeaders = <?php aw_headers($dataset) ?>
var myCells = <?php aw_cells($dataset) ?>
</script>
I have worked this out because if you manually enter the values and the grid works fine.
<script>
var myHeaders = ["Company Name"];
var myCells = [["A1 Moto"]];
</script>
And I know the dataset functions work because if I call the functions inside the php, and display them on the same page, they display the correct data!!
I have changed from Version 2.0 to 2.5, but I have tried using version 2.0 and the same problem persist.
Is it something to do with the opening php statement because it's shown on the forums as
var myHeaders = <?= aw_headers($dataset) ?>
var myCells = <?= aw_cells($dataset) ?>
But when I use <?= this dose not work either!
Help!
Jez
March 8,