I'm getting close to finisihing the first phase of a fairly large
application using ExtJS as the front end. Having only discovered ExtJS
about 2 months ago, I've been working my butt off to learn it and make
my app really shine by using it heavily for the UI (mostly grids,
tabs, forms & windows). For a business application, you can't beat the
look and feel of this UI.

Here are some random thoughts on my experience:

- The online API docs are a pure joy to work with. That's important,
because you'll find yourself getting *very* intimate with it as
constant reference. The viewer is written in ExtJS, check it out:
http://extjs.com/deploy/dev/docs/ and you'll see what I mean.

- The ExtJS API is very well thought out and thorough. It never ceases
to amaze how they've thought of everything. Everything so far that
I've needed to accomplish or solve, I've been able to. Sometimes it's
not readily apparent, but there's so many classes, methods and events
to work that you just need to keep reading the API. Did I mention it's
a joy to work with ;)

- In Cake, I've essentially eliminated all my views, and just send
down JSON packets for ExtJS to work with. The javascript helper's
object method works great for this...my views are essentially one
liners: <?php echo $javascript->object($data);?>

- My controllers have slimmed down considerably as the data arrays
returned from the models pass right through to the view (with a
success, total, and error messages tacked on to the arrays as needed).

- The xtemplate feature of ExtJS simply rocks. It allows you, for
instance, to loop through and render a record's related child data in
a grid cell into, say a bulleted list. I used to do all this on the
server in a view file that sends down all the data and markup. With
ExtJS able to do an awesome job with this sort of work, you just send
down the associative array data as JSON and let the pretty formatted
grid get rendered in javascript. It's super cool!

- There are bunches of user submitted extensions in the ExtJS
community forums that allow you to do some really cool things easily.
Do grid customizations, handle the showing of PDF's and other media in
a very slick fashion, change the look with a new theme, ...

- For forms, you can use a mapping feature of ExtJS's Record/
JsonReader to make your fields submit back in the Cake-expected
"data[Model][fieldname]" format. This is a very powerful technique as
it allows you to pass your cake generated associate PHP arrays UN-
TOUCHED! to the front end and receive it back. Here's what that
mapping looks like in ExtJS:

var AnalysisRecord = Ext.data.Record.create([
        {name: 'data[Analysis][id]', mapping: "Analysis.id"},
        {name: 'data[Analysis][user_id]', mapping: "Analysis.user_id"},
        {name: 'data[Analysis][analysis_name]', mapping:
"Analysis.analysis_name"},
        {name: 'data[Analysis][analysis_date]', mapping:
"Analysis.analysis_date", type: 'date', dateFormat: 'Y-m-d'}
]);

var AnalysisReader = new Ext.data.JsonReader({
    root: "data",
    successProperty: 'success'
    }, AnalysisRecord);

- I use Cake's requestHandler to help me distinguish between data read
requests (queries) and data changing action requests (Insert, edit,
deletes). Doing "POST" & "GET" requests to solve this didn't work
because often times I want to POST parameters to get data. So, all my
read requests use a .json extension and all my action requests use a
".ext" extension. My controller acts accordingly: if it sees .ext,
process the submitted form data, if it sees .json. No extension lays
down the initial page with any included js files needed for that page.
(I haven't gone totally ExtJS for the front end yet, so I still link
to high level pages, rather than loading ExtJS once and using all AJAX
requests thereafter...but that will come in time).

- Cake is convention over configuration...ExtJS is all about
configuration.  You'll get very comfortable using javascript object
notation if you're not already ;). It's neat stuff though.

I like what I'm hearing from the others in this thread about making
Cake components/helpers to hopefully eliminate the redundancy of
configuring ExtJS to know about your data structure. My approach isn't
optimal, but it's working. I'm up against some deadline for my first
release. The important part of this project is the user experience.
Once that is accomplished, then I'll take a step back and work on
programmer's experience, and look for ways to make marrying these two
awesome frameworks better.

As Chris likes to say: first make it work, then make it work better.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to