Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom search in ajax data?? #25

Open
masoud005 opened this issue May 24, 2016 · 1 comment
Open

Custom search in ajax data?? #25

masoud005 opened this issue May 24, 2016 · 1 comment

Comments

@masoud005
Copy link

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
Copy link
Author

please help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant