B4J Question DataTable initialization through web sockets (solved)

labcold

Member
Licensed User
Longtime User
I have a project which is using B4J server with websockets to render HTML including some complex tables.
All works well with the setup code as follows:
table initialisation for websocket:
'update table list
devs.RunMethod("dataTable", Array As Object(CreateMap("bLengthChange": False, "bPaginate": False, "sScrollY": "700px", "bInfo": False, "bAutoWidth": True, "bDestroy": True, "dom": "Bfrtip")))
The issue I have is with the PDF export button.
It works as expected and creates the PDF correctly using the PDFmake and associated plug ins.
BUT I want to set the orientation to Landscape and I cannot find how to pass that information in the table initialise statement above.

I need to add:
Attribute that I want to set:
        dom: 'Bfrtip',
        buttons: [
            {
                extend: 'pdfHtml5',
                orientation: 'landscape',
                pageSize: 'LEGAL'
            }
        ]

I have tried to add it as an object, as JSON but I cant get it to work.
Can anyone help?
Im sure its a simple case of formatting or casting but I dont seem to be able to make it work.

Yes of course it was a stupid mistake (tried to add another map) but just added array as object(.......) and it works fine :D
 
Last edited:
Top