ripe-action-67367
09/06/2022, 6:22 PMripe-action-67367
09/06/2022, 6:22 PMproud-librarian-99598
09/06/2022, 6:32 PMproud-librarian-99598
09/06/2022, 6:33 PMminiature-lizard-24702
09/06/2022, 6:37 PMmysterious-toddler-20573
09/06/2022, 7:22 PM||
with a backspace key filter as wellrhythmic-shoe-62185
09/06/2022, 10:12 PM/foo
and it has an inline partial named bar
, then the contents of the partial independently, minus the surrounding page, can be requested at /foo/bar
. still early in the design phase, but roughly am happy with how they are evolving.mysterious-toddler-20573
09/06/2022, 11:43 PMancient-father-3063
09/07/2022, 1:17 AMancient-father-3063
09/07/2022, 1:17 AM<div hx-trigger="myEvent from:body" hx-get="/example"></div>
When/How is this event triggered?ancient-father-3063
09/07/2022, 1:21 AMhtml
<input class="form-check-input" type="checkbox" name="checkbox" value="8" id="testtrigger" hx-trigger="myEvent">
<label class="form-check-label" for="filteractivedecks"><small>test trigger</small> </label>
<div hx-trigger="myEvent from:body" hx-get="/example"></div>
ancient-father-3063
09/07/2022, 1:21 AMmysterious-toddler-20573
09/07/2022, 1:23 AMHX-Trigger
?ancient-father-3063
09/07/2022, 1:23 AMancient-father-3063
09/07/2022, 1:24 AMancient-father-3063
09/07/2022, 1:25 AMancient-father-3063
09/07/2022, 2:05 AMancient-father-3063
09/07/2022, 2:06 AMancient-father-3063
09/07/2022, 2:06 AMancient-father-3063
09/07/2022, 2:06 AMdry-pharmacist-51808
09/07/2022, 2:25 AMancient-father-3063
09/07/2022, 2:27 AMancient-father-3063
09/07/2022, 2:27 AMancient-father-3063
09/07/2022, 2:28 AMancient-father-3063
09/07/2022, 2:29 AMhundreds-dusk-97323
09/07/2022, 7:16 AMhundreds-dusk-97323
09/07/2022, 7:16 AMripe-action-67367
09/07/2022, 7:27 AMhundreds-dusk-97323
09/07/2022, 7:41 AM<button
hx-get="ajax/testi.php"
hx-target="#modals-here"
hx-trigger="click"
class="btn btn-primary"
_="on htmx:afterOnLoad wait 10ms then add .show to #modal then add .show to #modal-backdrop">Open Modal</button>
<div id="modal-backdrop" class="modal-backdrop fade show" style="display:block;"></div>
<div id="modal" class="modal fade show" tabindex="-1" style="display:block;">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Modal title</h5>
</div>
<div class="modal-body">
<p>Modal body text goes here.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" onclick="closeModal()">Close</button>
<button type="button" class="btn btn-secondary" hx-get="ajax/testi.php">Save</button>
</div>
</div>
</div>
</div>
this save button open new modal.. can this something return only modal content current open modalstocky-dentist-80693
09/07/2022, 9:22 AMhx-select
and hx-target
that do the magic. I could add some other logic to be more selective to only render the table + pager, but it's slightly more effort for little gain in this instance.
php
// ... (other page stuff like title)
//
$search = form_input([
'type' => 'search',
'class' => 'pure-input-rounded w-100 pure-input-light',
'id' => 'search',
'name' => 'search',
'placeholder' => 'Search...',
'hx-get' => current_url(),
'hx-trigger' => 'keyup changed delay:75ms, search',
'hx-target' => '#results',
'hx-select' => '#results',
'value' => esc($filter->search ?? ''),
]);
echo "<div class='pure-form mb-md'>{$search}</div>";
echo "<div id='results'>";
echo $table->render(true);
echo $pager->links();
echo "</div>";