Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have entered into an existing project that is all about maintaining nested data structures. You have companies which are assigend to accounts, and contacts and notes and... basically the usual bunch of 1:1, 1..n, n:m Database relations, stored in mysql or postgres, wrapped by Doctrine.

Of course, every node comes with the usual set of metadata, that needs validation in terms of type (number, text, ...) and semantically (email, url, 'enums' like status, type, currency).

More specifically what I stepped into I would describe (also from previous experience) as typical ExtJS hell. Does this sound familiar to anyone?

  • a typical single URL-Application: No history, no meaningful specific bookmarks, oh and dare you pressing the back button...
  • tabbed browsing is impossible (the not so rare use case of looking at Customer A, while entering something meaningful into Account or Customer B side-by-side)
  • you have that typical navigation tree on the left, the stuff on the right is called in by Ajax. Data, but also a lot of executable java code.
  • a strong "MS Office feel": CSS sprites are far, far way, simple pullDowns and multiple-Choice buttons need effort to be 'dressed down' to be usable.
  • Not to mention all the clobbered div-s as opossed to few clean, semantically meaningful tags
  • a hell of javascript (some of it quite akwardly created in PHP) to suit hard-to-debug controllers and stores and plenty of redundant code, to ensure the same thing over and over again for the various data fields.Sure, there is OOP class hierarchy for those Ext.[ux.]grids and windows, but of limited help.

From previous experience I would LOVE to switch this to a straight REST-ful API, stuff is actually done between page request, the URl gives it to you just as it should look:

foo.com/accounts/16324/contact/create
foo.com/customer/search/state=California

And make the whole think jQuery-based, where I gain more control. That brings me to my general question: Do I miss a middle layer?

Trouble: I wonder, how to fill certain gaps (that other 'Converts' are likely to encounter, too, hence I dare to ask such broad question):

  1. what plugins would be good for (editable) tables? Including resizable, sortable comments? I know about jQueryUI and jQueryTools but I don't think that alone fits the bill. I need a really good table/grid think, probably with backend routines that fit.

  2. *Generally speaking, I feel, that I miss a middle layer between ORM and UI if I tinker with data structures, can I bring some automatism like "Here's my data structure, including types and validation rules, (oh, and the exisiting/default data) now build the form from it" Since this might vary from customer to customer, is another reason to not complete hardcode this to much.

Also the Ext-JS-ish store functionaliy of only sending back fields that truly changed would be worthwhile. As is recognizing dirty-ness (aka the need to confirm 'save/cancel' on dialog closing).*

  1. Very valuable would be generic mechanisms of "tentativene sub-Dialogs", e.g. Windows Screensaver do: So going into a Menu, from there to a submenu, saying ok on sub-dialog, then cancel on main ==> cancels the whole thing, nothing stored. In other words: Storing a few hierarchical data sets flexibly in the Session would be good. And pushing them into the DB (by repetive, generic means) when I got the actual "OK".

Any good pointers for me the table-editing part in the frontend and/or the data-structure middle part?

Thank you, Danke, Merci, Mille grazie, Xie xie!

Fronker

share|improve this question

1 Answer 1

... as typical ExtJS hell. Does this sound familiar to anyone?

a typical single URL-Application: No history, no meaningful specific bookmarks, oh and dare you pressing the back button...

It sounds like a nostalgic rant for simpler times.

tabbed browsing is impossible (the not so rare use case of looking at Customer A, while entering something meaningful into Account or Customer B side-by-side)

This is definitely possible; you can use ExtJS to create tabs or modify your links to do a full page refresh.

a hell of javascript (some of it quite akwardly created in PHP) to suit hard-to-debug controllers and stores and plenty of redundant code, to ensure the same thing over and over again for the various data fields.Sure, there is OOP class hierarchy for those Ext.[ux.]grids and windows, but of limited help.

This is just poor practice, independent of ExtJS. You should move all the JavaScript to the client side, clean it up, and then decide your next move. Switching to jQuery won't solve this problem. Sure, jQuery is simpler, but it sounds like you are relying on features of ExtJS that will be difficult to build with jQuery.

It sounds like you are new to ExtJS and reacting to the unfortunately steep learning curve. You should try righting the ship before abandoning it.

share|improve this answer
    
Agreed. jQuery is my preferred library, but I wouldn't try to convert an existing Ext project just because it's difficult. Ext has a ton of controls that jQuery just doesn't have yet. The Grid tops the list. I've used both libraries and agree that Ext is more difficult, but once you get the hang of it, you'll probably find simple solutions to the problems you're facing now. –  Adrian J. Moreno Oct 25 '11 at 15:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.