Commit b7fa5d3b authored by Romain Courteaud's avatar Romain Courteaud

erp5_web_renderjs_ui: add LabelField support

parent bb8474bf
......@@ -47,6 +47,8 @@
field_url = 'gadget_erp5_field_file.html';
} else if (field_type === 'IntegerField') {
field_url = 'gadget_erp5_field_integer.html';
} else if (field_type === 'LabelField') {
field_url = 'gadget_erp5_field_label.html';
} else if (field_type === 'ListBox') {
field_url = 'gadget_erp5_field_listbox.html';
} else if (field_type === 'EditorField') {
......
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />
<title>ERP5 Labelfield</title>
<link rel="http://www.renderjs.org/rel/interface" href="interface_erp5_field.html">
<link rel="http://www.renderjs.org/rel/interface" href="interface_erp5_form_content_provider.html">
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<!-- custom script -->
<script src="gadget_erp5_field_label.js" type="text/javascript"></script>
</head>
<body>
</body>
</html>
\ No newline at end of file
/*global window, rJS */
/*jslint indent: 2, maxerr: 3 */
(function (window, rJS) {
"use strict";
rJS(window)
.setState({
tag: 'p'
})
.declareMethod('render', function (options) {
var field_json = options.field_json || {};
return this.changeState({
value: field_json.value || field_json.default || ""
});
})
.onStateChange(function () {
this.element.innerHTML = this.state.value;
})
.declareMethod('getContent', function () {
return {};
})
.declareMethod('checkValidity', function () {
return true;
});
}(window, rJS));
\ No newline at end of file
......@@ -46,6 +46,8 @@ url_list = [
'gadget_erp5_field_image.js',
'gadget_erp5_field_integer.html',
'gadget_erp5_field_integer.js',
'gadget_erp5_field_label.html',
'gadget_erp5_field_label.js',
'gadget_erp5_field_list.html',
'gadget_erp5_field_list.js',
'gadget_erp5_field_lines.html',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment