PHP Classes

DrasticGrid Constructor Error

Recommend this page to a friend!

      DrasticTools  >  All threads  >  DrasticGrid Constructor Error  >  (Un) Subscribe thread alerts  
Subject:DrasticGrid Constructor Error
Summary:When setting up an example site, error in DrasticGrid.js class
Messages:5
Author:Robert Williams
Date:2008-08-23 18:29:04
Update:2009-09-15 04:22:51
 

  1. DrasticGrid Constructor Error   Reply   Report abuse  
Picture of Robert Williams Robert Williams - 2008-08-23 18:29:04
I'm trying to experiment with DrasticTools, which looks like a really cool tool. However, after downloading and unpacking the .zip file, and creating a database with the three sample sql files (not included in the 0.6.12 zip file sql folder, by the way; I had to find them in a previous release) on two completely different platforms, I cannot get the basic ExampleGrid1.php file to display the sample grid. On both platforms, both Firefox and IE throw a JS Error. Firefox's Error Console records the following two errors each time the page is accessed:

Error: Class is not defined
Source File: http://www.stls.lib.tx.us/DrasticTools/js/drasticGrid.js
Line: 44

Error: drasticGrid is not a constructor
Source File: http://www.stls.lib.tx.us/DrasticTools/ExampleGrid1.php
Line: 15

I've tried a multitude of combinations of setups to see if there was a path problem, a browser problem, or a server-side config problem. Here are the details of my setup:

DrasticTools folder is installed at the webroot of two different installations:

XAMPP, version 1.6.3a on Windows Vista Home Premium:
- PHP 5.2.3 (gd enabled; json v1.2.1 enabled)
- Apache 2.2.4
- MySQL 5.0.45

Linux, CentOS 4.x, standard CPanel shared hosting:
- PHP 5.2.4 (gd enabled; json v1.2.1 enabled)
- Apache 1.3.39
- MySQL 5.0.51a

I've tried the XAMPP local version under Firefox 3.0.x and IE 7.x (Windows Vista). I've tried the online version under Firefox 3.0.x and IE 7.x (Windows Vista) and Firefox 2.x under Windows XP Pro SP2.

The only change I've made to the basic DrasticTools files is editing the examplemysqlconfig.php file with appropriate user,password,database names. I've tried making sure the initial MySQL connection is good. Yes, the user/password/database info is accepted. But all I get is a blank screen with JS errors. (Actually, I've also tried putting absolute path names in the ExampleGrid1.php file, but no success.)

If anyone else has seen this and has a solution, I'd appreciate a response. After several hours of testing, I'm ready to move on to another tool.

--Robert

  2. Re: DrasticGrid Constructor Error   Reply   Report abuse  
Picture of dd dd - 2008-08-25 21:00:56 - In reply to message 1 from Robert Williams
Maybe the includes for mootools are not completely valid.
At least it sounds like a problem in the include structure on the javascript side, not a server problem.....

  3. Re: DrasticGrid Constructor Error   Reply   Report abuse  
Picture of Robert Williams Robert Williams - 2008-08-26 03:00:43 - In reply to message 2 from dd
Yep, you're so right. Man, I hate it when it's something simple I've overlooked. It was the mooltools. I'm so used to the "used" tools being part of the .zip archive, it slipped my notice that the mootools .js files weren't part of the .zip. I read in the licensing that DrasticTools uses mootools, but mootools is not in the list of prerequisites in the help doc.

Anyway, thanks for the assist! Much appreciated. Now on to some real experimentation.

--Robert

  4. Re: DrasticGrid Constructor Error   Reply   Report abuse  
Picture of dd dd - 2008-08-26 17:25:36 - In reply to message 3 from Robert Williams
Ok, great.

And I added a note in the documentation to attend people that mootools is really necessary (although the mootools files are also included in the drastictools distribution).

good luck.

  5. Re: DrasticGrid Constructor Error   Reply   Report abuse  
Picture of ernesto ernesto - 2009-09-15 04:22:51 - In reply to message 1 from Robert Williams
In the Drastic tools apears this warning...


Warning: mysql_num_fields(): supplied argument is not a valid MySQL result resource in /home/dmmb50/public_html/autos/class/carroaki.class.php on line 74
Could not find primary or unique key