datatable ajax send data values in array -


i tried using ajax/datable/codeigniter , want send data in post array data example (search['value'] = searched_key).

        function fetch_vtourdata( is_range_search, minprice = '', maxprice = '', minsurface = '', maxsurface = '', minnbroom = '', maxnbroom = '', searched_key = '')         {             var datatable = $('#data_tablevtourslist').datatable({                 "processing": true,                 "serverside": true,                 "order": [],                 "ajax":{                     url: "../../website/uservtourtable",                     type: "post",                     data: { 'user_id': user_id,                         // 1 = name of post, 2 = values                             is_range_search:is_range_search,                             minprice:minprice,                             maxprice:maxprice,                             minsurface:minsurface,                             maxsurface:maxsurface,                             minnbroom:minnbroom,                             maxnbroom:maxnbroom,                             search[{                                 'value':searched_key                             }]                            }                 },                 "columndefs" : [                     {                         "target": [0, 3, 4],                         "orderable": false,                     }                 ]             });              $('#search').keyup(function(){                 datatable.search($(this).val()).draw();             });         } 

enter image description here

my result same first post change :

search [{    'value' : searched_key }] 

by

searched_key: searched_key 

define in controller method :

if ( isset( $_post['searched_key'] ) && !empty( $_post['searched_key'] ) ) {      $_post['search']['value'] = $_post['searched_key'];     } 

Comments

Popular posts from this blog

What is happening when Matlab is starting a "parallel pool"? -

angular - DownloadURL return null in below code -

php - Cannot override Laravel Spark authentication with own implementation -