I'd like to change the rendering for DynamicForm and FormItem to use different HTML rendering.
In particular, I'd like to use twitter bootstrap styling on forms, which leaves most of the layout to CSS - unlike DynamicForm which uses tables to structure the layout.
I'm wondering what the most sensible approach is here. I see a few options:
1) don't use DynamicForm at all
2) write a custom getInnerHTML for DynamicForm - and likewise for each type of FormItem
3) transform the HTML generated by DynamicForm (override getInnerHTML) - ouch. ie, call the super method and strip out the table layout. dirty!
4) customize the HTML by directly editing DynamicForm.js - perhaps create a new FormLayoutType - FORM("form")
I suspect that 1) is probably the best course of action, although I can see a lot of work, eg validators, etc. 2) is likely the recommended best practice way to do this - although I imagine it will require a fair bit of re-implementing code as well. 3) is just wrong - but could be the quickest (but dirtiest) way to get this going. 4) seems appealing to me (and perhaps less work than 1 or 2), but means I'm creating a fork of the DynamicForm.js code to love and maintain till death do us part.
Any thoughts/suggestions appreciated.
In particular, I'd like to use twitter bootstrap styling on forms, which leaves most of the layout to CSS - unlike DynamicForm which uses tables to structure the layout.
I'm wondering what the most sensible approach is here. I see a few options:
1) don't use DynamicForm at all
2) write a custom getInnerHTML for DynamicForm - and likewise for each type of FormItem
3) transform the HTML generated by DynamicForm (override getInnerHTML) - ouch. ie, call the super method and strip out the table layout. dirty!
4) customize the HTML by directly editing DynamicForm.js - perhaps create a new FormLayoutType - FORM("form")
I suspect that 1) is probably the best course of action, although I can see a lot of work, eg validators, etc. 2) is likely the recommended best practice way to do this - although I imagine it will require a fair bit of re-implementing code as well. 3) is just wrong - but could be the quickest (but dirtiest) way to get this going. 4) seems appealing to me (and perhaps less work than 1 or 2), but means I'm creating a fork of the DynamicForm.js code to love and maintain till death do us part.
Any thoughts/suggestions appreciated.
Comment