Current Table is not converting to DataTable
Current Table is not converting to DataTable
So I have a current table that I have been trying to paginate and it comes out to be pretty difficult to paginate as is. I was looking for solutions and I came across Datatables. I have it installed and such into my project. I did the tutorial on setting up just the basic table and I was able to get that to work. I 'assumed" that all I had to do was exchange that id = 'table_id' and put it on my current table. I did that and all I got was the header reformatted and that was it. No pagination or any other of the DataTable options. Was my assumption wrong(too easy to be true)? Is there more I need to do to get it to work with my current table?
[code]
$(document).ready(function() {
alert('I am working'); //tests to see if this is being called
$('#table_id').dataTable( {
"sPaginationType": "full_numbers"
} );
});
[/code]
[code]
${message(code: 'User.username.label', default: 'Username')}
${message(code: 'User.id.label', default: 'ID')}
${message(code: 'User.timeStamp.label', default: 'Timestamp')}
${message(code: 'User.details.label', default: 'Details')}
${fieldValue(bean: audit, field: "username")}
${fieldValue(bean: audit, field: "id")}
${fieldValue(bean: audit, field: "timeStamp")}
Username: ${audit.username }
ID: ${audit.accountUuID }
EVENT TYPE: ${audit.eventType }
EVENT DETAILS: ${audit.eventDetails }
MESSAGE: ${audit.message }
[/code]
This is my existing table that I want converted over. I put exactly what the tutorial did on the bottom of this page to make sure I was calling everything correctly to this page and it worked out great, just doesn't work with this table. My tables can return results sizing from 0-5k+. I also get the 'infamous' "DataTables warning (table id = 'table_id'): Requested unknown parameter '0' from the data source for row 0" error that I have read online.
Any help would be greatly appreciated!
Thanks,
Nate
[code]
$(document).ready(function() {
alert('I am working'); //tests to see if this is being called
$('#table_id').dataTable( {
"sPaginationType": "full_numbers"
} );
});
[/code]
[code]
${message(code: 'User.username.label', default: 'Username')}
${message(code: 'User.id.label', default: 'ID')}
${message(code: 'User.timeStamp.label', default: 'Timestamp')}
${message(code: 'User.details.label', default: 'Details')}
${fieldValue(bean: audit, field: "username")}
${fieldValue(bean: audit, field: "id")}
${fieldValue(bean: audit, field: "timeStamp")}
Username: ${audit.username }
ID: ${audit.accountUuID }
EVENT TYPE: ${audit.eventType }
EVENT DETAILS: ${audit.eventDetails }
MESSAGE: ${audit.message }
[/code]
This is my existing table that I want converted over. I put exactly what the tutorial did on the bottom of this page to make sure I was calling everything correctly to this page and it worked out great, just doesn't work with this table. My tables can return results sizing from 0-5k+. I also get the 'infamous' "DataTables warning (table id = 'table_id'): Requested unknown parameter '0' from the data source for row 0" error that I have read online.
Any help would be greatly appreciated!
Thanks,
Nate
This discussion has been closed.
Replies
Sorry for the inconvenience!
Allan