|
|
 Christopher Miller - 2008-12-11 21:08:07
This is the first time I'm trying to impliment DrasticGrid and i'm having a host of problems.
I created a php file called reqs.php whos contents are as follows
[CODE]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<?php
include("drasticSrcMySQL.class.php");
$src = new drasticSrcMySQL("localhost", "xxx", "xxx", "digiconm_tunkhannock", "presidential");
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Grid</title>
</head>
<body>
<script type="text/javascript" src="js/mootools-1.2-core.js"></script>
<script type="text/javascript" src="js/mootools-1.2-more.js"></script>
<script type="text/javascript" src="js/drasticGrid.js"></script>
<div id="grid1"></div>
<script type="text/javascript">
var thegrid = new drasticGrid('grid1');
</script>
</body>
</html>
[/CODE]
and when I open the page i get 4 errors:
Warning: Cannot modify header information - headers already sent by (output started at /home/digiconm/public_html/fitness/DrasticTools/reqs.php:2) in /home/digiconm/public_html/fitness/DrasticTools/drasticSrcMySQL.class.php on line 121
Warning: Cannot modify header information - headers already sent by (output started at /home/digiconm/public_html/fitness/DrasticTools/reqs.php:2) in /home/digiconm/public_html/fitness/DrasticTools/drasticSrcMySQL.class.php on line 122
Warning: Cannot modify header information - headers already sent by (output started at /home/digiconm/public_html/fitness/DrasticTools/reqs.php:2) in /home/digiconm/public_html/fitness/DrasticTools/drasticSrcMySQL.class.php on line 123
Warning: Cannot modify header information - headers already sent by (output started at /home/digiconm/public_html/fitness/DrasticTools/reqs.php:2) in /home/digiconm/public_html/fitness/DrasticTools/drasticSrcMySQL.class.php on line 124
Warning: Cannot modify header information - headers already sent by (output started at /home/digiconm/public_html/fitness/DrasticTools/reqs.php:2) in /home/digiconm/public_html/fitness/DrasticTools/drasticSrcMySQL.class.php on line 129
any ideas?
 dd - 2008-12-11 22:01:51 - In reply to message 1 from Christopher Miller
Hi Christopher,
The php file should start with the
<?php
...
$src = new drasticSrcMySQL($server, $user, $pw, $db, $table);
?>
part, as in the examples on the drasticdata.nl site.
And the header info will be generated automatically.
So put NOTHING before the <?php
regards,
drasticdata team
 Christopher Miller - 2008-12-11 23:10:32 - In reply to message 2 from dd
wow, that was pure idiocy on my part...
I fixed that but now i'm getting a JS error: t.cols_numeric is null. Any ideas?
 dd - 2008-12-27 23:11:13 - In reply to message 3 from Christopher Miller
Hi Christopher,
That is interesting. It seems the code crashes on your dataset, probably because you have no single collumn that is numeric. The code somehow relies on the fact that there is always at least one column that is numeric, because most datasets (at least all the examples) have an "id" column that is an integer.
So in your case you can probably solve the problem by introducing an "id" column just as in the examples.
The drasticgrid code will be improved to test for numeric columns in the coming version.
regards, drasticdata
 Christopher Miller - 2008-12-28 21:02:24 - In reply to message 4 from dd
Great! that fixed my problem but now how would I hide that column in the grid table?
 dd - 2008-12-29 20:59:48 - In reply to message 5 from Christopher Miller
Hi Christopher,
Using the 'columns' option you can control which columns will be shown.
So, if you do not want to see the id column, just do not include the id column.... just like below (it is commented out, but you can of course also leave it out completely):
columns: [
//{name: 'id', width: 40},
{name: 'name'},
{name: 'email', type: DDTYPEMAILTO, width: 140},
{name: 'www', type: DDTYPEURL, width: 180},
{name: 'present'}
]});
regards, drasticdata
|