chg: [element:generic_index] Usage of UI factory for group_search
parent
e1a39c2b01
commit
0ff8655fb3
|
@ -53,15 +53,23 @@
|
|||
}
|
||||
?>
|
||||
var randomValue = '<?= h($tableRandomValue) ?>';
|
||||
$('#quickFilterButton-' + randomValue).click(function() {
|
||||
var url = '/' + controller + '/' + action + additionalUrlParams + '?quickFilter=' + encodeURIComponent($('#quickFilterField-<?= h($tableRandomValue) ?>').val());
|
||||
executePagination(randomValue, url);
|
||||
$(`#quickFilterButton-${randomValue}`).click(() => {
|
||||
doFilter($(this))
|
||||
});
|
||||
$('#quickFilterField-' + randomValue).on('keypress', function (e) {
|
||||
$(`#quickFilterField-${randomValue}`).on('keypress', (e) => {
|
||||
if(e.which === 13) {
|
||||
var url = '/' + controller + '/' + action + additionalUrlParams + '?quickFilter=' + encodeURIComponent($('#quickFilterField-<?= h($tableRandomValue) ?>').val());
|
||||
executePagination(randomValue, url);
|
||||
const $button = $(this).parent().find(`#quickFilterButton-${randomValue}`)
|
||||
doFilter($button)
|
||||
}
|
||||
});
|
||||
|
||||
function doFilter($button) {
|
||||
const encodedFilters = encodeURIComponent($(`#quickFilterField-${randomValue}`).val())
|
||||
const url = `/${controller}/${action}${additionalUrlParams}?quickFilter=${encodedFilters}`
|
||||
UI.reload(url, $(`#table-container-${randomValue}`), $(`#table-container-${randomValue} table.table`), [{
|
||||
node: $button,
|
||||
config: {}
|
||||
}])
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -1,13 +1,5 @@
|
|||
function executePagination(randomValue, url) {
|
||||
var target = '#table-container-' + randomValue
|
||||
$.ajax({
|
||||
dataType:"html",
|
||||
cache: false,
|
||||
success:function (data, textStatus) {
|
||||
$(target).html(data);
|
||||
},
|
||||
url:url,
|
||||
});
|
||||
UI.reload(url, $(`#table-container-${randomValue}`), $(`#table-container-${randomValue} table.table`))
|
||||
}
|
||||
|
||||
function executeStateDependencyChecks(dependenceSourceSelector) {
|
||||
|
|
Loading…
Reference in New Issue