Problem in getting message if there is empty table
Problem in getting message if there is empty table
Hi All,
I would like to have message if there is empty table. I have multiple table in my page and I would like to have this message for each table and I was trying with one table but it is not working.
Here is my code:
$(document).ready(function() {
var table7 = $('#table7').dataTable({
"bLengthChange": false,
"bFilter": false,
"oLanguage": {
"sInfoEmpty": "No data available"
}
});
var table8 = $('#table8').dataTable({
"bLengthChange": false,
"bFilter": false
});
});
When I used this code:
Table header is coming for table7 but message is not coming if it is empty table.
Is there anything wrong I am doing?
Thanks.
I would like to have message if there is empty table. I have multiple table in my page and I would like to have this message for each table and I was trying with one table but it is not working.
Here is my code:
$(document).ready(function() {
var table7 = $('#table7').dataTable({
"bLengthChange": false,
"bFilter": false,
"oLanguage": {
"sInfoEmpty": "No data available"
}
});
var table8 = $('#table8').dataTable({
"bLengthChange": false,
"bFilter": false
});
});
When I used this code:
Table header is coming for table7 but message is not coming if it is empty table.
Is there anything wrong I am doing?
Thanks.
This discussion has been closed.
Replies
Allan
here is my test case of table7:
In this code taking data from "data" via for loop and checking opsid2 and mp and if data is available then it display in tbody. but if data is not matching then it comes blank without "No data available" message, which I want. This code is a mixture of web2py python and html.
DB information on proteolytic event:
DB ID
Cleav No.
Cleav Seq
{{for row in data:}}
{{if opsid2 == row[7] and mp == row[15]:}}
{{=row[0]}}
{{=row[17]}}
{{=row[18]}}
{{pass}}
{{pass}}
I am still struggling in displaying empty table message.
In this code taking data from "data" via for loop and checking opsid2 and mp and if data is available then it display in tbody. but if data is not matching then it comes blank without "No data available" message, which I want. This code is a mixture of web2py python and html.
$(document).ready(function() {
var table7 = $('#table7').dataTable({
"bLengthChange": false,
"bFilter": false,
"oLanguage": {
"sInfoEmpty": "No data available"
}
});
var table8 = $('#table8').dataTable({
"bLengthChange": false,
"bFilter": false
});
});
DB information on proteolytic event:
DB ID
Cleav No.
Cleav Seq
{{for row in data:}}
{{if opsid2 == row[7] and mp == row[15]:}}
{{=row[0]}}
{{=row[17]}}
{{=row[18]}}
{{pass}}
{{pass}}
Please suggest me some solution...
Thanks