NYCPHP Meetup

NYPHP.org

[nycphp-talk] JSON and MVC

y2rob at aol.com y2rob at aol.com
Wed Jul 15 15:53:08 EDT 2009


hello,
yeah i'd look into extjs. ?i'm working with extjs now and all you need to do is pass it json and it will render grids for you based off a store you define in extjs calling your rest/service/gateway that renders the json. ?there are minor things you need to do like define a root for the data within your json as well as the meta data for the columns associated with the data in order to render the grid, but that's not too difficult to do. ?i might suggest creating a method to do this with the db abstraction you're using.




there is sorting, all done in extjs and done on the javascript level without having to make callbacks to your backend code. i'd use the latest before 3.0, that way you can use plugins, which haven't been ported over yet.




have fun,

~rob


-----Original Message-----
From: Tim Lieberman <tim_lists at o2group.com>
To: NYPHP Talk <talk at lists.nyphp.org>
Sent: Wed, Jul 15, 2009 2:31 pm
Subject: Re: [nycphp-talk] JSON and MVC







On Jul 15, 2009, at 11:59 AM, Hans Zaunere wrote:?
?

>?

> So I think I see what you're saying.  Keep all markup (aside from > perhaps the initial request) off the server.?

>?

> I thought about this, and played around with it a bit.  There are a > couple of problems, or at least contradictions...?

>?

> -- everyone I talk to says do as much as you can on the server?
?

Why?  In the sort of app you're describing, the view code is (mostly, almost nearly entirely) javascript.?
?

> -- and with good reason, since complex JS is just a hack after another?
?

Don't fear the javascript.  With the various compatibility/helper libraries, it's actually a pretty predictable environment to work in.?
?

Look at what the ExtJS guys have done, for example.  Your typical "do a desktop-style-app-in-a-browser" application has only enough HTML to output a script tag or two and load a stylesheet.?
?

> -- if I do only receive raw "bare-metal" data points via JSON from > the server, it seems that the JS complexity gets astronomic, which > has obvious problems and frankly greatly reduces overall application > agility in my opinion (ie, markup structure, visual appearance, and > application logic are once again lumped together).?
?


Yes, the javascript gets complicated, but you can abstract a lot of that, with a little elbow grease.?
?

You end up with a javascript environment that looks a lot like the event-driven kind of environment from desktop UI libraries.?
?

Now, this kind of architecture isn't going to degrade, let alone gracefully, if the user doesn't have javascript, but in many cases that ends up being acceptable.?
?

_______________________________________________?

New York PHP User Group Community Talk Mailing List?

http://lists.nyphp.org/mailman/listinfo/talk?
?

http://www.nyphp.org/show_participation.php?



 




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20090715/c8f29a20/attachment.html>


More information about the talk mailing list