optikalefx / OpenJS-Grid

OpenJS Grid is the easiest jQuery Grid ever. With very little work you can have a data grid that can do everything from sorting and searching to complex database queries. Best of all, its open source. So you can learn how it's all done.
http://square-bracket.com/openjs
MIT License
96 stars 46 forks source link

Sticks on loading #28

Closed cihat74 closed 11 years ago

cihat74 commented 11 years ago

Hi,

I am trying to test it on localhost but it keeps showing the "Loading" message. I'm not a developer so can you lead me the way ?

optikalefx commented 11 years ago

There is probably an issue with the database part - if you are in chrome, open dev tools, go to network, click on the ajax call and then "preview" on the right. You will get to see any error that is there.

cihat74 commented 11 years ago

Oh my, I was really looking forward to your reply. I did what you say and the error it says is:

XMLHttpRequest cannot load file:///C:/xampp/htdocs/OpenJS-Grid-master/ajax.php. Origin null is not allowed by Access-Control-Allow-Origin.

optikalefx commented 11 years ago

So openJSGrid requires a web server to run. You are running it just by double clicking on the index file. For this to work locally you have run like WAMP or run it on your web server.

PHP can't run on your computer unless you are doing it from a local web server.

Here is a tutorial for XAMPP which is another webserver for windows just like WAMP http://www.tested.com/tech/2501-how-to-run-a-local-web-server-to-host-web-apps/

--- edit Of course you can just upload these to your FTP for your web server and install the database there. Unfortunately if your completely new to web sites, php and mysql, this isn't going to be a walk in the park.

cihat74 commented 11 years ago

Aha..:)

You thought I'm a baby in web stuff. When saying I'm not a developer, I mean I'm a drone. I appreciate the great work you do and your aim. But I'm too old to start learning code-writing.

Turning to the subject, XAMPP is open now. In fact while waiting for your reply I was working on Phpgrid.

I created lots of databases and tables in search of that plugin such as Flexigrid, Phpgrid, JqEasyUI and such. But yours (if I can even start) will surely look quite cool.

Edit: Apache and Mysql are running, should I start another?

optikalefx commented 11 years ago

Sorry about the assumption! If your webserver is running make sure you are running the index from your browser as http://localhost and that you have put all the grid files in your web root on your computer.

Thanks!

cihat74 commented 11 years ago

No need to say sorry. I'm not offended of course, I'm just a toddler beside you :)

Let me write what I did.

I extracted the zip file into htdocs, created a database (but here I was a bit confused because in ajax.php database was "test" but in sample.sql it was "cmi_test"), that's why I executed the sql in both and created the tables. I clicked the "index.html". The result is a box with the title "Users" and it writes "Loading" in it.

optikalefx commented 11 years ago

Good catch about the sample.sql. Make sure that if your using cmi_test that you name ajax.php that way in the file.

To run this though, you can't click on index.html - since PHP has to run, you have to run this from http://localhost/ in your browser.

cihat74 commented 11 years ago

image

Still no change...

cihat74 commented 11 years ago

image

This is the other working now.

optikalefx commented 11 years ago

Can you checkout the error for me again now?

cihat74 commented 11 years ago

I couldn't find Ajax call on Network section, I just wrote the error message I saw before. I don't see the error message now.

image

cihat74 commented 11 years ago

Can that help ?

image

optikalefx commented 11 years ago

Can you email your ajax.php file? Missing argument 2 means your calling the grid without the 2nd param, which is the settings for the grid. But I don't think you modified my file?