Commit Graph

11 Commits

Author SHA1 Message Date
Andreas Stöckel
4869ca9a49 Implemented hiding grid columns and rows, fixed bug with et2_template::isInTree returning false in the wrong places and thus not all values being transmitted back to the server 2011-08-22 15:58:47 +00:00
Andreas Stöckel
5af5594f60 Major update of the et2_widget internal structure. The following changes were made:
- All attributes of the widgets are now parsed from XML before the widget itself is created.
These attributes plus all default values are then added to an associative array. The associative array is passed as second parameter to the init function of et2_widget, but is also available as this.options *after* the constructor of the et2_widget baseclass has been called.
The et2_widget constructor also calls a function parseArrayMgrAttrs(_attrs) - in this function widget implementations can read the values from e.g. the content and validation_errors array and merge it into the given _attrs associative array.
After the complete internal widgettree is completely loaded and created the "loadingFinished" function gets called and invokes all given setter functions. After that it "glues" the DOM tree together. This should also (I didn't measure it) be a bit faster than before, when the DOM-Tree was created on the fly. 

Please have a look at the changes of the et2_textbox widget to see how this affects writing widgets.

Note: The "id" property is copied to the object scope on the top of the et2_widget constructor.

- When widgets are cloned the "options" array gets passed along to the newly created widget. This means that changes made on the widgets during runtime are not automatically copied to the clone - as this didn't happen anyhow it is not a really disadvantage.
On the other side there should be no difference between widgets directly inside the "overlay" xet tag and widgets which are inside instanciated templates.

- The selbox widget doesn't work anymore - it relied on the loadAttributes function which isn't available anymore. et2_selbox should use the parseArrayMgrAttrs function to access

- I've commented out some of the "validator"-code in etemplate2.js as it created some error messages when destroying the widget tree.
2011-08-19 16:00:44 +00:00
Andreas Stöckel
f9914e069c Fixed problem with getValues iterating over widgets which are in proxied templates 2011-08-15 10:04:37 +00:00
Andreas Stöckel
bb4aab7854 Fixed two dependencies 2011-08-15 08:42:07 +00:00
Andreas Stöckel
2fc29718f1 Added correct handling of namespaces 2011-08-12 16:29:24 +00:00
Andreas Stöckel
b9bb6280e3 Added getValues() function to the base widget which creates an associative 'array' with all form values. 2011-08-12 12:15:44 +00:00
Andreas Stöckel
4f2eeaafe1 Fixed problem with id not being copied when cloning an template rewrote a part of the attribute merging system - now not only references of the attribute descriptors are copied between the instances. 2011-08-10 16:23:02 +00:00
Andreas Stöckel
68c7a5550e - Styled button a little bit
- Added test for textbox
- Added baseWidget and inputWidget classes
- Implemented attribute system
- Implemented statustext as a test for the attribute system
- Ported csv_split function to JS
- Implemented system for the legacy options
- Added function for iterating over the widget tree
2011-08-10 14:36:31 +00:00
Andreas Stöckel
db990deffd Improved grid, now correctly renders the timesheet.edit template, grid cells are now automatically expanded, grid objects can now be cloned and used in templates, added dummy implementation for button and textbox, added JS 'use strict' to be notified about JS programming mistakes in FF 4+. 2011-08-07 13:43:46 +00:00
Andreas Stöckel
b4530a6d3e Implemented first version of the grid component (not complete) 2011-08-06 14:36:44 +00:00
Andreas Stöckel
8b2dae28f7 - Checked browser compatibility, tested with IE8, Chrome, Opera, FF3.6
- Added indexOf function for IE compatiblity - this and some other code is redundant to that in egw_action_common.js - Probably this code should be merged into jsapi and jsapi.js should be cleaned up and splitted into multiple files
- Implemented template widget
- Implemented dummy implementation of description widget
- Improved et2_placeholder - it now shows all properties set for that placeholder
- Improved and extended test page
- Improved interface system in et2_inheritance.js - each object derrived from Class now has a instanceOf function which checks, whether the object is either an instance of the given class or implements the given interface (same behaviour as instanceOf in Java)
- Widgets can now define which other widget classes are allowed inside of them
2011-08-05 14:53:54 +00:00