Nittro clickable table row

5 months ago

izytech_thomas
Member | 11
+
0
-

Hi,

Im searching for a method to make a table row clickable and execute a signal action with nittro. jQuery with clickable row fires an request but it does not fit in the nittro package. Is there an function to call in nittor or an tag that can be added in the TR element to fire an ajax request to Nette?

jQuery(document).ready(function($) {

    $(".clickable-row").click(function() {
        var hrefVar = $(this).data("href");
        $.get(hrefVar);
    });


});
<tbody n:snippet="entries">
    {foreach $items as $entry}
        <tr class="clickable-row" data-href="search?do=hello">
            <td>{$entry->getId()}</td>
            <td class="name"><a n:href="hello!">{$entry->getName()}</a></td>
            <td>{$entry->getScb()}</td>
            <td></td>
            <td></td>
        </tr>
    {/foreach}
</tbody>

Best regards
Thomas

5 months ago

izytech_thomas
Member | 11
+
0
-

Could anyone give me an hint?

about a month ago

jahudka
Member | 66
+
0
-

hi, sorry, I completely missed this! I know you've probably moved on long ago, but just in case anybody else stumbles upon this thread:

The most strict “Nittro equivalent” of $.get() would be di.getService('ajax').get(url, params = null), but in your case I suppose you'd be better off with di.getService('page').open(url, method = 'GET', params = null, context = null), which would take care of updating all snippets etc.

Also Nittro now has its own forum here: https://forum.nittro.org