Commit 8ab9f25d authored by Pratap Vardhan's avatar Pratap Vardhan
Browse files

BUG: formhandler clear all removes all params

parent d9984e46
Pipeline #75684 passed with stage
in 2 minutes and 13 seconds
......@@ -327,7 +327,7 @@ Each template receives these variables:
_.each(args[key], function(col_name) {
var update = {}
update[key] = col_name
qparts.update(update) %>
qparts.update(update, 'add') %>
<a href="?<%- key %>=<%- col_name %>" data-mode="del" class="badge badge-pill badge-dark urlfilter" title="Clear <%- key %> filter">
<%- key %> = <%- col_name %>
</a>
......
......@@ -65,6 +65,7 @@
<div class="custom_buttons4" data-src="/formhandler-data"></div>
<div class="custom_buttons5" data-src="/formhandler-data"></div>
<div class="fh18" data-src="/formhandler-data"></div>
<div class="fh17" data-src="/formhandler-data"></div>
<div class="fh15" data-src="/formhandler-data"></div>
<div class="fh16" data-src="/formhandler-data"></div>
......@@ -538,6 +539,19 @@
t.end()
})
})
tape('$().formhandler() test clear all for multiple filters', function (t) {
window.history.pushState({}, '', '#')
window.history.pushState({}, '', '#' + g1.url.parse().update({ 'Continent': ['Asia', 'Europe'], _limit: 5 }).toString())
$('.fh18').formhandler()
.on('load', function () {
var filter_badges = $('body > div.fh18 > div.position-relative > div.formhandler > div.formhandler-table-header > div.d-flex > div.filters > div > a')
t.equal(filter_badges[0].text.trim(), 'Continent = Asia')
t.equal(filter_badges[1].text.trim(), 'Continent = Europe')
t.equal(filter_badges[2].getAttribute('href'), '?Continent=Asia&Continent=Europe')
window.history.pushState({}, '', '#')
t.end()
})
})
// tape('$().formhandler() add new rows', function (t) {
// $('.fh_add1')
// .formhandler({
......
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