开发者

Simple AJAX DataGrid display problem

I have an ajax datagrid that displays a list of items in the customer's cart, and lets them edit these quantities, which then updates the database.

It works perfectly on my personal Abyss Web Server on localhost. But when I upload it to my www.winhost.com servers, it never displays the grid! It's the exact same code! I don't know what to do, I have tried everyth开发者_如何学Cing I could think of. Any help at all is appreciated, Please help!

Thanks!


Some things that come to mind and might be worth doublechecking:

  1. Does your database contain data?
  2. Are your javascript references being loaded correctly? Use firebug to verify.
  3. Have you checked for any PHP errors? Like require_once() statements that are failing?

You can check by putting this PHP before any other code being executed:

error_reporting(E_ALL); 
ini_set('display_errors', '1'); 

That's all I can think of for now.


The code you've posted is mostly irrelevant to the problem - the bit that is responsible for rendering the table is in AjaxDataGrid.class.php

The html generated has a lot of dependencies - check that you can access each of the javascript, and css files from a browser.

I assume from your question that the content after the require_once() statement and the grid renders OK - i.e. that the script is not stopping because it can't read the include file.


Look here is my strategy in your ajax handler comment out ever thing then try to create some data your self and see if you can get the data on client side If no then check your ajax request use this bit of code to print your $_GET values.

ob_start();
print_r($_GET);
$output = ob_get_clean();
file_put_contents('debug.txt',$output);

I am sure you will find that something is wrong if it didn't work try to make your ajax call in an small scale test version, it sounds funny but it help me lots of time find out what is wrong.

I hope these help you and I don't have any other idea cause I have never been stacked more then this .... :)

Best luCk!


I have solved this problem with an alternative as help was insufficient (but very appreciated).

I decided to roll my own PHP/AJAX Editable DataGrid. I will be releasing it completely free (no open source, just free), when I get the time sometime soon and will edit this answer with a link to the source code.

Thanks all for your help and effort. :)


I'm not sure what is going wrong, because I only see "Select Database" on the page now, but since it is working on one system and not on another, maybe the error is in writing to the ajax log file?

By the way, I'm getting a bunch of Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'username'@'192.168.110.101' (using password: YES) in E:\web\username\configurations.php on line 10 Could not connect: Access denied for user 'username'@'192.168.110.101' (using password: YES) errors on several other pages on your site now, but maybe you're just working on it.


  • You don't seem to have posted code of checkout.php.

I can see from the starting of html which has title tag having something different from what is seen on another page, where your grid is not generated.

You are of course checking the correct page on your server I guess.

  • But something strongly suggests your problem is because of something trivial and not actually with code itself. .. I get that feeling from

"..it works on my local server, but fails on the host..".

Going by the above line, the usual stuff people miss when hosting on a different machine are:

a. Checking the wrong page.. while updating the wrong script

b. Thinking that they have updated the script on server.. while their FTP upload of script actually didn't update the file for some reason... and the old code remains giving old problems which are fixed locally.

c. Your php could have errors, but for some reason it is being ignored and generation of page completes.. may be you should try error_reporting(E_ALL); on the first lines of your problematic php page.. also ensure display_errors flag and related error flags on the php ini on server are true.. may be your hosting admin can help change the flags if they are not like they should be..

d. Your hosting server and dev server have varied php parameters or config which you should first understand.. you should generate a phpinfo() page on your local server and compare its ouptput with a similar page result from the hosting server.

Other than the above, you could also check this,

On the Checkout page, I see that no grid code is even generated.. so it is not a matter of javascript hiding something.. also javascript is not throwing any errors on browser.. so it could be something as simple as the grid class file itself not being included in the appropriate place on your checkout page.. or something trivial which could show up if you are able to see php errors on the page.

Because your code works on your machine or locally.. I am going to assume you should not need to debug or change any code unless you see anything creepy from phpinfo comparison of missing deps, or seeing errors after error_reporting(E_ALL)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜