zepernick / Codeigniter-DataTables

CodeIgniter Library For Ajax Server Side DataTables 1.10 >
MIT License
93 stars 94 forks source link

Custom search in ajax data?? #25

Open masoud005 opened 8 years ago

masoud005 commented 8 years ago

would you please help me? i can post data to model for the first time when the page is loading.but after that,i couldnt post data each time i do it, this is how i load the datatable: ` var config = { processing: true, serverSide: true, "bFilter": true, "bSort": true, ajax: { "url": JS_BASE_URL + "/accounts/accounts_list", "type": "POST", "data": { 'username': $(#uname).val() } }, aoColumns: [ {data: "c.id"}, {data: "c.name"}, {data: "c.username"}, {data: "c.mobile"} , columnDefs:[ { "className" : "account_id" , "targets": [0], } ] };

var table = $("#sampleOrderTable").dataTable(config).dataTableSearch(300); and for searching i wrote: $("#uname").live("keyup", function() { table.dataTable()._fnAjaxUpdate(); });` This post the $(#uname).val() but the first value i know the config is declared for the first time when loading, but i dont know how to post changing value of input #uname

masoud005 commented 8 years ago

please help