Can I use jquery and data tables with jstl ???
Can I use jquery and data tables with jstl ???
Hi !
I'm using jstl, and I'd like to use dataTables, but It doesn't work, have anybody done this before ??? How ???
My code, I've made a lot of proofs and I changed the original code, but it doesn't work yet, now the error is " object expected " and then "jquery is undefined". I also try to import de js's files with and
var $j =jQuery.noConflict(); and the error was "jQuery is undefined""
[code]
window.onLoad= CreateTable();
var $j = jquery.jQuery.noConflict();
var oTable;
$j(document).ready(function() {
CreateTable();
});
function CreateTable(){
/* Init the table */
oTable = $('#example').dataTable({
"bPaginate":true,
"iDisplayLength": 50 ,
"bLengthChange": false,
"bFilter": false,
"sPaginationType": "full_numbers",
"bAutoWidth": false,
"aoColumns": [
{sWidth: '20px'},
{sWidth: '20px'},
{sWidth: '30px'},
{sWidth: '50px'},
{sWidth: '50px'},
],
"oLanguage": {
"sLengthMenu": "Mostrar _MENU_ rexistros por paxina",
"sZeroRecords": "Non existen rexistros",
"sInfo": "Mostrar de _START_ a _END_ de _TOTAL_ rexistros",
"sInfoEmtpy": "Mostrar de 0 a 0 a 0 registros",
"sInfoFiltered": "(filtrado de _MAX_ rexistros totais)",
"sSearch": "Procurar" ,
"oPaginate":{
"sNext": "Seguinte",
"sFirst": "Primeiro",
"sPrevious":"Anterior",
"sLast":"Ultimo"
}
}
});
}
[/code]
It seems not to read the js's files.
Any idea ??
Thanks
I'm using jstl, and I'd like to use dataTables, but It doesn't work, have anybody done this before ??? How ???
My code, I've made a lot of proofs and I changed the original code, but it doesn't work yet, now the error is " object expected " and then "jquery is undefined". I also try to import de js's files with and
var $j =jQuery.noConflict(); and the error was "jQuery is undefined""
[code]
window.onLoad= CreateTable();
var $j = jquery.jQuery.noConflict();
var oTable;
$j(document).ready(function() {
CreateTable();
});
function CreateTable(){
/* Init the table */
oTable = $('#example').dataTable({
"bPaginate":true,
"iDisplayLength": 50 ,
"bLengthChange": false,
"bFilter": false,
"sPaginationType": "full_numbers",
"bAutoWidth": false,
"aoColumns": [
{sWidth: '20px'},
{sWidth: '20px'},
{sWidth: '30px'},
{sWidth: '50px'},
{sWidth: '50px'},
],
"oLanguage": {
"sLengthMenu": "Mostrar _MENU_ rexistros por paxina",
"sZeroRecords": "Non existen rexistros",
"sInfo": "Mostrar de _START_ a _END_ de _TOTAL_ rexistros",
"sInfoEmtpy": "Mostrar de 0 a 0 a 0 registros",
"sInfoFiltered": "(filtrado de _MAX_ rexistros totais)",
"sSearch": "Procurar" ,
"oPaginate":{
"sNext": "Seguinte",
"sFirst": "Primeiro",
"sPrevious":"Anterior",
"sLast":"Ultimo"
}
}
});
}
[/code]
It seems not to read the js's files.
Any idea ??
Thanks
This discussion has been closed.
Replies
1. I'd recommend upgrading to jQuery 1.4 - DataTables isn't tested with 1.2 at all any more (it might well work - it might well not :-) )
2. $j(document).ready(function() - isn't going to work (some of the times - it might for Safari, Firefox etc if the DOM loads quickly enough - which it should), since you have put in your own window.onload event handler. This might just be hacked in testing code though.
3. $('#example').dataTable({ - should that be $q()... ?
4. - I've no idea what this does :-). I guess it's an include of some sort - and it doesn't look like it's working as expected. I'd suggest asking at a ColdFusion site (or whatever language it is that you are using).
Allan
So, now I,m trying this code:
[code]
var oTable;
$(document).ready(function() {
alert("document ready");
CreateTable();
});
function CreateTable(){
oTable = $('#example').dataTable({
"bPaginate":true,
"iDisplayLength": 50 ,
"bLengthChange": false,
"bFilter": false,
"sPaginationType": "full_numbers",
"bAutoWidth": false,
"aoColumns": [
{sWidth: '20px'},
{sWidth: '20px'},
{sWidth: '30px'},
{sWidth: '50px'},
{sWidth: '50px'},
],
"oLanguage": {
"sLengthMenu": "Mostrar _MENU_ rexistros por paxina",
"sZeroRecords": "Non existen rexistros",
"sInfo": "Mostrar de _START_ a _END_ de _TOTAL_ rexistros",
"sInfoEmtpy": "Mostrar de 0 a 0 a 0 registros",
"sInfoFiltered": "(filtrado de _MAX_ rexistros totais)",
"sSearch": "Procurar" ,
"oPaginate":{
"sNext": "Seguinte",
"sFirst": "Primeiro",
"sPrevious":"Anterior",
"sLast":"Ultimo"
}
}
});
}
[/code]
I didn't upgrade to jQuery 1.4 yet, but I will.
The alert doesn't appear, any idea ??
Allan
Thanks, any idea left ????
Allan
[code] $(document).ready(function() {
alert('document ready');
CreateTable();
});
[/code]
I upgraded jquery to 1.4
Thanks
Allan