koop1koop
asked on
Wordpress PHP Datagrid Component
Hello,
I have a datagrid that I am trying to integrate with WordPress with little success.
I have downloaded it from http://phpgrid.wordpress.com/ and have the full paid version.
The problem I have is that when I create a template for WordPress and use it on my homepage I can see the datagrid with the data filled in (see attached working), when I use the same template on another page there is no data in the datagrid (see attached not working)
If i change the permalinks to default it works on all pages but when the permalinks are set to Post name then it only works on the homepage.
I have included the jqgrid_dist.php with its full path, i dont see any errors on the page to suggest it is not seeing the included script, if I change the include location to one I know is not there the I do get an error saying unable to locate the file.
Can anyone suggest a way I can get this to work with the permalinks set to Post name.
Please let em know if you need any more info
not-working.png
working.png
I have a datagrid that I am trying to integrate with WordPress with little success.
I have downloaded it from http://phpgrid.wordpress.com/ and have the full paid version.
The problem I have is that when I create a template for WordPress and use it on my homepage I can see the datagrid with the data filled in (see attached working), when I use the same template on another page there is no data in the datagrid (see attached not working)
If i change the permalinks to default it works on all pages but when the permalinks are set to Post name then it only works on the homepage.
I have included the jqgrid_dist.php with its full path, i dont see any errors on the page to suggest it is not seeing the included script, if I change the include location to one I know is not there the I do get an error saying unable to locate the file.
Can anyone suggest a way I can get this to work with the permalinks set to Post name.
Please let em know if you need any more info
not-working.png
working.png
ASKER
Sorry how do you mean browser console?
I have called it normally (see attached)
mcare-donor-stock.php
I have called it normally (see attached)
mcare-donor-stock.php
ASKER
The location where it is not working is http://www.multicare.org.uk/test/
I'm on my iPad today, so I can't test it for you until later, but I will test it later.
http://javascript.about.com/od/reference/a/debug.htm
The link above explains how to debug JavaScript using the browser console.
http://javascript.about.com/od/reference/a/debug.htm
The link above explains how to debug JavaScript using the browser console.
ASKER
I looked at the browser console but I don't seem to see any error's but then again I don't think I know what I am looking for.
ASKER
Please can you help me on this, I am a loss on how to proceed
No errors come up in the console and the grid renders. The data does not populate, so check to see if your connections to the data source are correct?
Also, you are invoking JQuery twice. Once in the theme and once again in the page template. That can cause conflicts and kill any functionality with jquery. You need to use wp_enqueue_script() to make sure you don't cause conflicts:
http://codex.wordpress.org/Function_Reference/wp_enqueue_script
Also, you are invoking JQuery twice. Once in the theme and once again in the page template. That can cause conflicts and kill any functionality with jquery. You need to use wp_enqueue_script() to make sure you don't cause conflicts:
http://codex.wordpress.org/Function_Reference/wp_enqueue_script
ASKER
Thanks for taking a look, as I mentioned before the page template works fine if it is set to the home page it is just when it is set to any other page it doesnt work.
The author of the scripts seems to think that it could be a problem could be wordpress not passing parameters in custom permalinks and suggested putting in the htaccess
RewriteRule . /index.php [L,QSA]
in place of
RewriteRule . /index.php [L]
I have tried this and still get the same result
So to wrap up it is not the jquery as it works when set to the home page and its also not the connection script for the same reason.
The author of the scripts seems to think that it could be a problem could be wordpress not passing parameters in custom permalinks and suggested putting in the htaccess
RewriteRule . /index.php [L,QSA]
in place of
RewriteRule . /index.php [L]
I have tried this and still get the same result
So to wrap up it is not the jquery as it works when set to the home page and its also not the connection script for the same reason.
That's why I mentioned checking the path to the data source. If it works at root but not a level down. It may bethe script is looking for the data in the wrong place. I'm just guessing here as all I can see is the rendered code from the front-end link you provided.
ASKER
but if i change the permalink structure to default it then works on the page I need it to, if you would like access to the site let me know
Because default permalinks are all index.php?p=XXXX so the relative path is always the same. Custom permalinks screw with that so any relative paths need to be changed to absolute.
ASKER
I have tried it with absolute path too but I get the same result
I'm stumped then. Since the grid renders on the test link without data I'm almost certain the data call is the problem. Hopefully that narrows down your search and efforts.
ASKER
i have been looking at the following type of solutions but i'm not quite sure how I would implement it
http://www.rlmseo.com/blog/passing-get-query-string-parameters-in-wordpress-url/
http://www.rlmseo.com/blog/passing-get-query-string-parameters-in-wordpress-url/
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Found the problem
Also, did you call scripts "normally" or did you use wp_enqueue_script() ?