Commit eb791248 authored by Gabriel Monnerat's avatar Gabriel Monnerat

erp5_web_renderjs_ui: avoid errors when there is no data

parent a022b117
......@@ -25,7 +25,7 @@
</div>
</div>
<div class="bottom">
<input type="submit" class="ui-disabled" data-i18n="[value]Reset Filter" value="Reset Filter" disabled />
<input type="submit" class="ui-disabled reset-filter" data-i18n="[value]Reset Filter" value="Reset Filter" disabled />
</div>
</body>
</html>
\ No newline at end of file
......@@ -244,7 +244,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>994.33037.54289.49544</string> </value>
<value> <string>997.7172.17438.7031</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -262,7 +262,7 @@
</tuple>
<state>
<tuple>
<float>1630625748.53</float>
<float>1641309745.94</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -197,11 +197,13 @@
})
.onEvent("click", function (evt) {
var gadget = this,
restore_filter_input = gadget.element.querySelectorAll("input")[0];
restore_filter_input = gadget.element.querySelector(".reset-filter");
if (evt.target === restore_filter_input) {
evt.preventDefault();
if (restore_filter_input) {
restore_filter_input.disabled = true;
restore_filter_input.classList.add("ui-disabled");
}
return gadget.redirect({
command: "change",
options: {
......@@ -370,9 +372,11 @@
});
})
.push(function () {
var restore_filter_input = gadget.element.querySelectorAll("input")[0];
var restore_filter_input = gadget.element.querySelector(".reset-filter");
if (restore_filter_input) {
restore_filter_input.disabled = false;
restore_filter_input.classList.remove("ui-disabled");
}
});
});
......
......@@ -246,7 +246,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>997.17600.7409.53606</string> </value>
<value> <string>997.18816.40125.35669</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -264,7 +264,7 @@
</tuple>
<state>
<tuple>
<float>1641237395.88</float>
<float>1641310195.82</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