Variable not accepted on .clumnFilter aoColumns

Variable not accepted on .clumnFilter aoColumns

arcovoltaicoarcovoltaico Posts: 2Questions: 0Answers: 0
edited May 2012 in DataTables 1.9
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

Replies

  • arcovoltaicoarcovoltaico Posts: 2Questions: 0Answers: 0
    Got no JS cookie value solution. Instead I found how to have the php option working on my shared hosting just by changing my htaccess lines from :

    //fallaba desde en subdominio u-vox
    SetHandler application/x-httpd-php


    to:


    AddHandler application/x-httpd-php5 .js


    Hope it helps to anyone ;)
This discussion has been closed.