Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Is it possible use a library https://datatables.net/?

Questions related to using nuBuilder Forte.
Post Reply
miasoft
Posts: 156
Joined: Wed Dec 23, 2020 12:28 pm
Location: Russia, Volgograd
Has thanked: 32 times
Been thanked: 7 times
Contact:

Is it possible use a library https://datatables.net/?

Unread post by miasoft »

I have use this library in JoomlaComponentBuilder. It's very impressive.
Is any examples or tutorials for nubuilder?
I am new and don't know where I must insert this strings
27.12.png
You do not have the required permissions to view the files attached to this post.
Wbr, miasoft.
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: Is it possible use a library https://datatables.net/?

Unread post by kev1n »

Hi,

Yes, you can use it within nuBuilder. Basically, you

1. Download the library from https://datatables.net/download/ and unpack it into a subfolder. E.g libs/datatables

2. In the (Setup ->) Header, add:

Code: Select all

</script>

<link href="libs/datatables/jquery.dataTables.min.css" rel="stylesheet">
<script src="libs/datatables/jquery.dataTables.min.js"></script>

<script>
3. Place the HTML code of your table in a HTML object.

4. Initialize the Plugin in the form's Custom Code as shown in the examples:

Code: Select all

$(document).ready(function() {
    $('#example').DataTable();
} );

If you have further questions, it might be easier to discuss on discord.

ernesttan1976
Posts: 51
Joined: Sat May 16, 2020 10:08 am

Re: Is it possible use a library https://datatables.net/?

Unread post by ernesttan1976 »

Very nice!
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: Is it possible use a library https://datatables.net/?

Unread post by kev1n »

This was some updated code I posted on Discord:

What still needs to be done is to handle the events, like click on a row, load next page etc..

Code: Select all

if (nuFormType() == 'browse') {
  
    $(document).ready(function() {

        $("DIV[id^='nuBrowse']").hide();
        $("DIV[id^='nucell']").hide();
        $("#nuRECORD").prepend('<table id="browse_dt" class="display" style="width:150%"></table>').css('width', '700px');
        $('#nuActionHolder').hide();
        $('.label').css('position', 'relative');

        $('#browse_dt').DataTable({
            data: nuSERVERRESPONSE.browse_rows,
            columns: nuSERVERRESPONSE.browse_columns
        });

    });
  
}
Post Reply