Revize db961a64
Přidáno uživatelem Filip Jani před více než 5 roky(ů)
app/FrontModule/component/Transliteration/TransliterationSearchResultList.latte | ||
---|---|---|
60 | 60 |
{/foreach} |
61 | 61 |
|
62 | 62 |
{control searchSettingsForm} |
63 |
{/snippet} |
|
63 |
|
|
64 | 64 |
|
65 | 65 |
{block scripts} |
66 | 66 |
<script> |
67 | 67 |
$(document).ready(function () { |
68 |
let limit = $('select[name="limit"]');
|
|
69 |
limit.change(function () {
|
|
70 |
console.log(limit.val()); |
|
68 |
$('select[name="limit"]').change(function () {
|
|
69 |
let limit = this.value;
|
|
70 |
|
|
71 | 71 |
$.nette.ajax({ |
72 | 72 |
url: {link changeLimit!}, |
73 |
data: {'limit': limit.val()}
|
|
73 |
data: {'limit': limit} |
|
74 | 74 |
}) |
75 | 75 |
}); |
76 | 76 |
|
... | ... | |
79 | 79 |
}); |
80 | 80 |
}) |
81 | 81 |
</script> |
82 |
{/block} |
|
82 |
{/block} |
|
83 |
{/snippet} |
app/FrontModule/component/Transliteration/TransliterationSearchResultList.php | ||
---|---|---|
86 | 86 |
return $form; |
87 | 87 |
} |
88 | 88 |
|
89 |
public function handleChangeLimit($limit)
|
|
89 |
public function handleChangeLimit() |
|
90 | 90 |
{ |
91 |
$this->paginator = new Paginator(1, Paginator::ALLOWED_LIMITS[$limit]); |
|
92 |
$this->redrawControl('resultList'); |
|
91 |
if($this->presenter->isAjax()) |
|
92 |
{ |
|
93 |
$limit = $this->presenter->getParameter('limit'); |
|
94 |
|
|
95 |
if($limit) |
|
96 |
{ |
|
97 |
$this->paginator = new Paginator(1, Paginator::ALLOWED_LIMITS[$limit]); |
|
98 |
$this->redrawControl('resultList'); |
|
99 |
} |
|
100 |
} |
|
93 | 101 |
} |
94 | 102 |
} |
95 | 103 |
|
Také k dispozici: Unified diff
Re #7328 handle pro počet výsledků na stránku