PDA

View Full Version : Complete Grid/mySQL/PHP example anyone?



perlmonger
3 Jan 2007, 11:16 AM
In order to quickly evaluate whether the YUI library and Jack's extension library are what I want, could someone provide a complete example of a working database application? I'd like to see how the backend php code interacts with the YUI frontend. I've been looking at the docs for a few hours and I think it would take quite some time to glean the information from the API docs. I'm evaluating this for a small php web application at work and I don't have a lot of time to spare in evaluating the usability of this. I'm sure it would be fantastic but if I can't get a quick grasp of how to throw together a demo database application I'm afraid I won't have the time necessary to learn the whole API. I would then just have to do it the way we currently do, hand coded php and html. This would be the perfect opportunity to change the way we do our php applications.

I'd really like to give this a try so if anyone could post or refer to some code I'd appreciate it greatly.

buzz
3 Jan 2007, 12:24 PM
I'm amazed at the number of requests I see by people request complete working examples (demos) without putting any effort into developing one themselves. Jack has post numerous examples of using the grid - wouldn't that be enough for you to decide on whether the framework meets your needs or not?

perlmonger
3 Jan 2007, 12:36 PM
I'm amazed at the number of requests I see by people request complete working examples (demos) without putting any effort into developing one themselves. Jack has post numerous examples of using the grid - wouldn't that be enough for you to decide on whether the framework meets your needs or not?

So, I'm guessing that you don't have any examples you would like to share. I simply thought that if someone had an application which they had used or created to learn about using the library it would be helpful to myself and others. Such an example would most likely reduce the number of questions one would have when beginning and thereby reducing the number of basic questions on this board.

tryanDLS
3 Jan 2007, 12:48 PM
How many more examples do you need? Have you looked at all the examples in the blog/doc? You haven't posted anything that would indicate that you've spent any time with the samples, or extending them.
This makes your post look like you don't want to expend the effort, but you'd rather copy as much of somebody else's hard work as possible. That may not be your intent, however that's how these types of requests are interpreted in a lot of cases.

perlmonger
3 Jan 2007, 1:00 PM
Thanks for the replies. If I have time this week to get a demo application up I'll post the code for the next guy.

mjlecomte
10 Jul 2007, 8:38 AM
I happened across this thread looking for help with getting a working example. It looks like the initial poster's request for help was rejected for 'being lazy'. I'm also new to extjs and I'm probably not as experienced as many here. So it's not a matter so much of being lazy as knowing where to look and seeing more examples.

Some of the examples I have seen don't illustrate the connection to the back end (php in my case). Also with more examples I find some people comment more or say something in a different way that makes more sense so I can learn easier.

Obviously I can't "post a tutorial" when I'm trying to learn it in the first place. Once I do learn it enough I'd more than likely contribute back for the next guy. But that's a chicken and egg problem for me personally.

modelracer
10 Jul 2007, 9:24 AM
Seconded....

Whilst I have absolutely no problem with following tutorials and examples - I like the other two posters was looking around for a specific php/mysql example - however I am right now doing my own php/json/mysql example so will bung it up when i get it done if that helps.

Cheers

Oo

VinylFox
10 Jul 2007, 9:59 AM
Here is a complete example with all the source files available to download in a zip file.

http://extjs.com/learn/Tutorial:Basics_of_Paging_With_the_Grid_Component

How much easier can it get?

modelracer
10 Jul 2007, 10:01 AM
Time for a visit to the opticians methinks.....

I stand corrected.

Oo

mjlecomte
15 Jul 2007, 9:39 AM
Seconded....

Whilst I have absolutely no problem with following tutorials and examples - I like the other two posters was looking around for a specific php/mysql example - however I am right now doing my own php/json/mysql example so will bung it up when i get it done if that helps.

Cheers

Oo

I did see that tutorial. I'd still be interested to see what you come up with modelracer. Your particular example php/json/mysql is exactly what I'd like to do and an example or two of all 3 components would be welcomed. I have a basic grasp of all 3, but the other tutorials left me wanting a bit more clarification.

In the example above (http://extjs.com/learn/Tutorial:Basics_of_Paging_With_the_Grid_Component) I did not understand the "totalProperty" specifically. Can someone explain that further?

Also if someone could explain here or edit that page for the part that says "NOTE: There is a portion missing here that should describe the creation of column model and the grid widget."


In general I'm also unsure of the proxy thing. From Scott's screencast (http://extjs.com/learn/Screencast:Grid_Component) I gather there are 3 different ways to handle the proxy . Can someone clarify my understanding of the 3 methods below?

As far as I have been able to figure out:


Ext.data.MemoryProxy(gridData)
use when data is static (an array in the javascript file, etc)
an example would be:
-javascript file has a variable called 'gridData' with an array of data
Ext.data.HTTPProxy
use when data source is coming from same server that the page as requested from
an example would be:
-active page is: http://www.domain.com/something/index.com
-accessing data from: http://www.domain.com/something/model.php
Ext.data.ScriptTagProxy
use when data source is coming from different location than where the web page is being rendered from
an example would be:
-active page is: http://www.domain.com/something/index.com
-accessing data from: http://www.otherDomain.com/something/model.php

VinylFox
15 Jul 2007, 11:41 AM
In the example above (http://extjs.com/learn/Tutorial:Basics_of_Paging_With_the_Grid_Component) I did not understand the "totalProperty" specifically. Can someone explain that further?

The tutorial says...

"The only difference in the data Store is the addition of a totalProperty declaration. In our example, we use 'total' which is coming from our server side script with the value for the total number of rows we had before breaking them up into pages."

Which just means if your JSON has "blabla: 23" being used as your count variable, then you should set totalProperty: 'blabla' . Does that make more sense?


Also if someone could explain here or edit that page for the part that says "NOTE: There is a portion missing here that should describe the creation of column model and the grid widget."

That note should not have been there, since the example only covers adding paging to a grid, the column model and grid creation are irrelevant. I have fixed it now. Thanks.


In general I'm also unsure of the proxy thing.

Your dead on with this one. Seems like your grasp of this is just fine.