Commit 3a2a70f2 authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Add getTextContent on string field

parent 022e7c58
......@@ -7,6 +7,7 @@
.setState({
tag: 'p'
})
.declareMethod('render', function (options) {
var field_json = options.field_json || {},
state_dict = {
......@@ -19,6 +20,7 @@
state_dict.text_content = state_dict.value;
return this.changeState(state_dict);
})
.onStateChange(function (modification_dict) {
var element = this.element,
gadget = this,
......@@ -46,7 +48,6 @@
.push(function (input) {
return input.render(gadget.state);
});
})
.declareMethod('getContent', function () {
......@@ -59,6 +60,13 @@
return {};
})
.declareMethod('getTextContent', function () {
return this.getDeclaredGadget('sub')
.push(function (gadget) {
return gadget.getTextContent();
});
})
.declareMethod('checkValidity', function () {
if (this.state.editable) {
return this.getDeclaredGadget('sub')
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>954.34570.5720.55227</string> </value>
<value> <string>954.35858.57287.35225</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1476197972.06</float>
<float>1476273908.28</float>
<string>UTC</string>
</tuple>
</state>
......
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