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