eneko
7 Sep 2007, 6:22 AM
Hi,
I am trying to build a polling website and decided to use Ext as GUI, because of obvious reasons. However, I am a little lost with the design (software design and patterns) of Javascript based GUI components.
I need to show many components of the same class (i.e poll mini-windows, where users can vote) many times on a page. These mini-windows are Ext based layout components (Rails partial templates) with many things inside, like buttons and tabled, and they need a huge amount of JS code to work. As I need to render many of these components per page, there's repeated JS code that should be removed.
Also, I haven't actually written any code yet, but I think that It would be really difficult to reference elements by id, because there would be many elements with the same id (one per rendered component). I could concat an unique id to every element, but it isn't a good design approach.
Please, any suggest about how to design the Ext-intensive mini-windows without repeating code and easily referencing each element's inner components?
Thank you for advance.
PD: Excuse my poor english
Eneko
I am trying to build a polling website and decided to use Ext as GUI, because of obvious reasons. However, I am a little lost with the design (software design and patterns) of Javascript based GUI components.
I need to show many components of the same class (i.e poll mini-windows, where users can vote) many times on a page. These mini-windows are Ext based layout components (Rails partial templates) with many things inside, like buttons and tabled, and they need a huge amount of JS code to work. As I need to render many of these components per page, there's repeated JS code that should be removed.
Also, I haven't actually written any code yet, but I think that It would be really difficult to reference elements by id, because there would be many elements with the same id (one per rendered component). I could concat an unique id to every element, but it isn't a good design approach.
Please, any suggest about how to design the Ext-intensive mini-windows without repeating code and easily referencing each element's inner components?
Thank you for advance.
PD: Excuse my poor english
Eneko