pdf button
pdf button
suser
Posts: 68Questions: 18Answers: 0
With the help of this https://datatables.net/extensions/buttons/examples/html5/simple.html i try to export pdf file now i want to ask
how button is generate i create the button or created by js files?
This discussion has been closed.
Answers
The buttons are created automatically when you specify them inside the datatables initialisation.
You specify which buttons you would like here-
Then the buttons are added to the table.
Thanks
Tom
ok but i try to achieve this but their is no buttons
DataTables requires that you have
tbody
andthead
elements in your table. See the documentation for more information.Also your HTML table isn't valid - your first row has more cells than any other.
Allan
ok now i have sveral other links for datepicker like and grid liknks like this
when i build this then this show conflicts of js files and show that error
Uncaught TypeError: $(...).shieldDatePicker is not a function
@allan
That isn't a DataTable issue. However, the issue is most likely that you are loading jQuery multiple times for some reason. I see 5 different versions in the above code.
Allan
yes so how i edit this ? and which one i remove this
hey now i try this and this show error like this
jquery.dataTables.min.js:65 Uncaught TypeError: Cannot read property 'aDataSort' of undefined
@allan
There is no data in the table. No columns, no nothing. If you want to define columns use
columns
, or just put them in your HTML.Allan
now the problem is when i hard code table liket his
then this perfectly works but when i just use this
Plain text
but when i populate table through jquery and web static method like this
then buttons not visible when i use this
how to solve
@allan
You have to initialise the DataTable after you have inserted it into the document. Also note that you are adding a
tbody
for every row, which is not something DataTables supports. It only allows onetbody
at the moment.Allan