Skip to content

Commit 6fdeb34

Browse files
committed
Fixed bug where URL parameters were only handled during column sorting.
1 parent b4b4655 commit 6fdeb34

File tree

1 file changed

+8
-4
lines changed
  • django_responsive_tables2/static/django_responsive_tables2

1 file changed

+8
-4
lines changed

django_responsive_tables2/static/django_responsive_tables2/tables.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ function updateHeaders(tableId, url, tableElement) {
1111
for (const [key, value] of Object.entries(sortParameters)) {
1212
urlParameters[key] = value;
1313
}
14-
url = clearParameters(url);
15-
updateTable(tableId, url + encodeParameters(urlParameters));
14+
url = clearParameters(url) + encodeParameters(urlParameters);
15+
updateTable(tableId, url);
1616
};
1717
}
1818
}
@@ -30,8 +30,12 @@ function updateTable(tableId, url, search=null) {
3030
}
3131
}
3232
};
33-
if (search) xhr.open('GET', url + "?search=" + search, true);
34-
else xhr.open('GET', url, true);
33+
if (search) {
34+
urlParameters = decodeParameters(url);
35+
urlParameters["search"] = search;
36+
url = clearParameters(url) + encodeParameters(urlParameters);
37+
}
38+
xhr.open('GET', url, true);
3539
xhr.send();
3640
}
3741

0 commit comments

Comments
 (0)