View Full Version : Dynamic control position by end users

22 Mar 2011, 8:04 AM

I'm currently new to ExtJS, and this is my first time posting, so please forgive me if this has already been answered in the past, although I did try to search.

We are about to undertake a major rewrite of our current desktop application (a very large commercial product) and ExtJS seems to fit our bill very well, however there's one major requirement which I've not been able figure out if the framework could handle it, namely the ability for end users to re-arrange field positions on the forms and we should be able to persist the layout and load that layout when the user opens that same form again.

We are envisioning to show the user with a list of available fields (preferably the fields defined on the model) and they should be able to remove or re-arrange the fields position.

Thanks in advance

Shloma Baum

22 Mar 2011, 5:16 PM
I have done exactly that... i'm still working because right now is very basic, but this is what i can tell you.

ExtJS provides all you need to create a custom designer but you have to write it by yourself, in my case i created a basic designer that allows me to create a form tab based, where you can add fieldsets, columns but right now only three columns are allowed, and with the tree (the outline view) you can drag and drop the fields and move them between columns and fieldsets or just simply reorder them...

When i hit save i build and xml and send that to the server to persist the layout in the database but before that, i read the xml and generate some records to preserve the integrity between the metadata table fields and form fields used in the layout, also i generate records for fieldsets and tabs because in the future i want to be able to add multilangue feature...

So when the page is loaded, i parse the xml and generate javascript code (form controls, tabs, fieldsets, columns) from that and and it simply works perfectly, it also has support for border layout, hidden fields, and master detail (i had to create a component to render other component by a given url)...

Here is an screenshot

22 Mar 2011, 5:20 PM
Here is the full size image. Can't edit the last post in advanced mode.


23 Mar 2011, 6:42 AM
Wow! this is exactly what I was looking to do.... Is there some sort of plugin like this available to purchase?

23 Mar 2011, 10:56 AM
well.. i have not seen one so far that's why i decided to build mine...

23 Mar 2011, 11:09 AM
SO would you be willing to sell it as a plugin?

24 Mar 2011, 9:41 AM
We are currently exploring the dynamic generation of forms out of our database model as well. At the moment we have pure HTML based entry forms which let us define the attributes and the business cases under which the form elements show up. Using a renderer we load the form definition from the database and create the form in ExtJS on the fly.

With a designer like the one displayed by Greivin it would be much nicer for us to define the attributes of a business object / class and create multiple forms for it. So count us in with helping and testing a designer which can be plugged into multiple backend frameworks, as I have a feeling all three of us use entirely different frameworks and at least us, programming languages (or have your heard of XoTCL and OpenACS / ]project-open[) ?