Variable not accepted on .clumnFilter aoColumns
Variable not accepted on .clumnFilter aoColumns
arcovoltaico
Posts: 2Questions: 0Answers: 0
Dear Alan and friends,
Unfortunately when passing a value to aoColumns, the filters are not being applied.
code is :
$(document).ready(function(){
var filters = urlDecode($.cookie("filters_es"));
// var filters = ' {type: "text"}, {type: "text"}, {type: "text"}'; // also checked without success on a 3-column table
$('#mytable').dataTable({
....
and then:
.columnFilter({
//aoColumns: [ {type: "text"}, {type: "text"}, {type: "text"}] // filter applied
//aoColumns: [ <?php echo $_SESSION['filters'];?>] // was ok on my htaccess modified localhost
//aoColumns: [ alert(filters)] // the filters values are ok ...
aoColumns: [filters] // but no filters applied :(
})
-----------
As commented above, the straigth JS version is not working, seems that the value of filters is not well received as a valid parameter for aoColumns, after 3 hours I'm going crazy with this ... Could you help me to find where's the problem?
It's kinda weird but when filter value was passed to aoColunms as a php variable everything was working nice, but sadly now I'm forced to avoid this PHP approach since my shared hosting limitations.
Btw: -> debug code: ajibew (view)
Thanks a lot ;)
Jordi Alhambra
Unfortunately when passing a value to aoColumns, the filters are not being applied.
code is :
$(document).ready(function(){
var filters = urlDecode($.cookie("filters_es"));
// var filters = ' {type: "text"}, {type: "text"}, {type: "text"}'; // also checked without success on a 3-column table
$('#mytable').dataTable({
....
and then:
.columnFilter({
//aoColumns: [ {type: "text"}, {type: "text"}, {type: "text"}] // filter applied
//aoColumns: [ <?php echo $_SESSION['filters'];?>] // was ok on my htaccess modified localhost
//aoColumns: [ alert(filters)] // the filters values are ok ...
aoColumns: [filters] // but no filters applied :(
})
-----------
As commented above, the straigth JS version is not working, seems that the value of filters is not well received as a valid parameter for aoColumns, after 3 hours I'm going crazy with this ... Could you help me to find where's the problem?
It's kinda weird but when filter value was passed to aoColunms as a php variable everything was working nice, but sadly now I'm forced to avoid this PHP approach since my shared hosting limitations.
Btw: -> debug code: ajibew (view)
Thanks a lot ;)
Jordi Alhambra
This discussion has been closed.
Replies
//fallaba desde en subdominio u-vox
SetHandler application/x-httpd-php
to:
AddHandler application/x-httpd-php5 .js
Hope it helps to anyone ;)