Skip to content

Custom search in ajax data?? #25

@masoud005

Description

@masoud005

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions