I'm getting an error "Object doesn't support property or method 'column'. How do I fix this?
I'm getting an error "Object doesn't support property or method 'column'. How do I fix this?
kmh158
Posts: 5Questions: 1Answers: 0
I'm running the same code on IE11 using sharepoint 2013. I used the same example of coding that you have provided. I couldn't find anything to fix this issue.
This discussion has been closed.
Answers
$('#example thead tr').clone(true).appendTo( '#example thead' );
$('#example thead tr:eq(1) th').each( function (i) {
var title = $(this).text();
$(this).html( '<input type="text" placeholder="Search '+title+'" />' );
This what I'm using
I don't see where you are defining your
table
variable. Please could you post a link to a test case showing the issue per the forum rules?My guess is that you are using
$().dataTable()
rather than$().DataTable()
as noted in the top FAQ.Allan
My guess is the problem is with
table.column(i)
in line 2. What does the variabletable
contain? In your code it is expected to be the Datatables API, ie,var table = $('#myTable').DataTable();
. Seems like it must be something else.Hard to say without seeing it. Please post a link to your page or a test case so we can take a look.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
this what I have for "table"
var $tabel = $('#mytable');
var $parent = $table.children('tbody');
var table = $table.dataTable();
var $tabel = $('#mytable');
var $parent = $table.children('tbody');
var table = $table.dataTable();
$('#example thead tr').clone(true).appendTo( '#example thead' );
$('#example thead tr:eq(1) th').each( function (i)
{
var title = $(this).text();
$(this).html( '<input type="text" placeholder="Search '+title+'" />' );
$( 'input', this ).on( 'keyup change', function () {
if ( table.column(i).search() !== this.value ) {
table
.column(i)
.search( this.value )
.draw();
}
} );
});
This the how the code looks like that I have
var table = $table.dataTable();
needs to bevar table = $table.DataTable();
to use the API. Note theD
in `DataTable. Please see this FAQ for more details.Kevin
I changed it to DataTable(), but it's still giving me the same error
Hi @kmh158 ,
We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin
Looks like a typo. In line 1 you have
$label
and in line 5 you have$table
. If this doesn't help then as Colin mentions we will need to see it.Kevin