Closed aaronflorey closed 10 years ago
Please paste here the var_dump of Input::get() so I can reproduce that.
I added another column, so now the offset is 4 (I updated my post to show this).
Array
(
[draw] => 2
[columns] => Array
(
[0] => Array
(
[data] => 0
[name] =>
[searchable] => true
[orderable] => true
[search] => Array
(
[value] =>
[regex] => false
)
)
[1] => Array
(
[data] => 1
[name] =>
[searchable] => true
[orderable] => true
[search] => Array
(
[value] =>
[regex] => false
)
)
[2] => Array
(
[data] => 2
[name] =>
[searchable] => true
[orderable] => true
[search] => Array
(
[value] =>
[regex] => false
)
)
[3] => Array
(
[data] => 3
[name] =>
[searchable] => true
[orderable] => true
[search] => Array
(
[value] =>
[regex] => false
)
)
[4] => Array
(
[data] => 4
[name] =>
[searchable] => true
[orderable] => true
[search] => Array
(
[value] =>
[regex] => false
)
)
)
[order] => Array
(
[0] => Array
(
[column] => 0
[dir] => desc
)
)
[start] => 0
[length] => 10
[search] => Array
(
[value] => tes
[regex] => false
)
[_] => 1406261721534
)
I took a while for my to understand exactly what you are trying to do, but think I understand it now. Your DT is requesting some action on column that does not exists in SQL query. I this case it is obvious for me that this column should be set orderable=false in columns definition for datatables.js.
This is because this package works in this way:
So if you try to filter on added column the filtering function cannot see it.
To avoid this kind of situation I will add a code that is checking for existence of column before trying to filter it. It is possible that this kind of checking existed previosly, but when I rewrote all this functions to use new format I didn't notice that someone can try to filter on non existing column.
I commited new Datatables.php, please check if the issues are solved.
I'm getting undefined offset when using search. I'm using 1.4 of your package and 1.11 of DT. The issue is that, i'm adding a 'operartions' column and datatables is sending that column back, but because i'm not selecting it your package doesn't know what column 3 is.
My bandaid solution was to remove the 4th column from the input array like so.
Not sure if there's a proper way of doing this?
thanks