• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

Question about updating a variable after ajax filtering

sasha199

Member
Hello everyone, I'm changing the template default_row.php, where I add its id to the string class
PHP:
<?php echo $this->_row->data->sbrh2_tabel_pers___id;?>
I noticed such a problem, after filtering data using ajax, the id remains from the old record and is not updated, how can I get the id after applying the filter? I also noticed that the id is not updated even after going to the next page.
 
And how to get the name of the column that is specified after the name of the table in the database, for example, sbrh2_tabel_pers___D1, How do I get D1? it is prescribed in default_row.php list style,
PHP:
<?php echo $this->cellClass[$heading]['class']?>
 
Doesn't anyone really know how to get the id of the string after ajax is triggered? Please tell me, I have been looking for a solution for three days.
 
Hello everyone again, I could not solve the problem, how to get the id in the default_row template, can someone help?
 
It turned out to get the id after loading ajax, can you tell me how to add the result to the class in the row that this id belongs to?
JavaScript:
requirejs(['fab/fabrik'], function(test) {
    Fabrik.addEvent('fabrik.list.update', function(list) {
        var data = list.options.data;
        // data is an array of groups, each group is an object of rows, each row has a data object, each data object has a  __pk_val item which will have the row id
        data.each(function (group) {
            group.each(function (row) {
                // do whatever you need with row.data.__pk_val
                console.log(row.data.sbrh2_tabel_pers___id);
            });
        });
    });
});
 
Last edited:
This is not Fabrik but JS. Check your page source. I think the tr tag has id="list...row_X"

So remove your old class and add the new one
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top