mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-23 23:29:31 +01:00
5af5594f60
- 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.
66 lines
2.6 KiB
HTML
66 lines
2.6 KiB
HTML
<html>
|
|
<head>
|
|
<title>ET2 - Test</title>
|
|
|
|
<script src="jquery.js"></script>
|
|
<script src="../et2_xml.js"></script>
|
|
<script src="../et2_inheritance.js"></script>
|
|
<script src="../et2_common.js"></script>
|
|
<script src="../et2_arrayMgr.js"></script>
|
|
<script src="../et2_widget.js"></script>
|
|
<script src="../et2_DOMWidget.js"></script>
|
|
<script src="../et2_baseWidget.js"></script>
|
|
<script src="../et2_valueWidget.js"></script>
|
|
<script src="../et2_inputWidget.js"></script>
|
|
<script src="../et2_template.js"></script>
|
|
<script src="../et2_description.js"></script>
|
|
<script src="../et2_grid.js"></script>
|
|
<script src="../et2_button.js"></script>
|
|
<script src="../et2_box.js"></script>
|
|
<script src="../et2_hbox.js"></script>
|
|
<script src="../et2_textbox.js"></script>
|
|
<script src="../et2_number.js"></script>
|
|
<!-- <script src="../et2_selectbox.js"></script>-->
|
|
<script src="../et2_checkbox.js"></script>
|
|
<script src="../et2_radiobox.js"></script>
|
|
<script src="../et2_styles.js"></script>
|
|
<script src="../et2_html.js"></script>
|
|
|
|
<script src="../etemplate2.js"></script>
|
|
|
|
<script src="../et2_tabs.js"></script>
|
|
<script src="../lib/tooltip.js"></script>
|
|
<script src="../../../phpgwapi/js/jsapi/jsapi.js"></script>
|
|
<script src="../../../phpgwapi/js/jquery/jquery.tools.min.js"></script>
|
|
|
|
|
|
<script src="et2_test_timesheet_edit.json"></script>
|
|
<script src="et2_test_expressions.json"></script>
|
|
<link rel="StyleSheet" type="text/css" href="./test.css" />
|
|
</head>
|
|
<body>
|
|
<h1>EGroupware ETemplate2 Test</h1>
|
|
<div class="header">Choose one of the following tests:</div>
|
|
<div id="linklist">
|
|
<a href="#" onclick="open_xet('et2_test_timesheet_edit.xet', timesheet_data);">Timesheet edit dialog</a>
|
|
<a href="#" onclick="open_xet('et2_test_template.xet');">Template proxy test</a>
|
|
<a href="#" onclick="open_xet('et2_test_grid.xet');">Grid test</a>
|
|
<a href="#" onclick="open_xet('et2_test_tabbox.xet');">Tabs test</a>
|
|
<a href="#" onclick="open_xet('et2_test_textbox.xet');">Textbox test</a>
|
|
<a href="#" onclick="open_xet('et2_test_description.xet');">Description test</a>
|
|
<a href="#" onclick="open_xet('et2_test_basic_widgets.xet');">Basic widgits</a>
|
|
<a href="#" onclick="open_xet('et2_test_expressions.xet', expression_test_data);">Expression test</a>
|
|
<a href="#" onclick="open_xet('et2_test_hbox.xet');">HBox test</a>
|
|
</div>
|
|
<div class="header">ETemplate2 container:</div>
|
|
<div id="container"></div>
|
|
<script>
|
|
var et2 = new etemplate2(document.getElementById("container"), "");
|
|
|
|
function open_xet(file, content) {
|
|
et2.load(file, content);
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|