1
こんにちは、私は、データ入力付きの選択入力を使用してサーバー側の検索を実装しようとしましたが、選択された入力値をサーバー側に渡すように見えません。datatable ajaxデータ入力選択検索サーバー側が機能しない
は、基本的には、それが
は、私が何かをしないのです...フッタと変更イベントの火災これで入力リストを移入しますが、サーバー側に選択された値を渡しませんか?いくつかの助けは非常に高く評価されるだろう。var table = $('#tbl_product_list');
// begin first table
table.dataTable({
// Internationalisation. For more info refer to http://datatables.net/manual/i18n
"processing": true,
"serverSide": true,
"ajax":
{
"url": "/Product/GetProductData",
"type": "POST",
"dataType": "JSON"
},
"columns": [
{
"data": "ProductName"
},
{
"data": "ProductCategory"
},
{
"data": "ProductType"
},
{
"data": "ProductSize"
},
{
"data": "CurrentQuantity"
},
{ "data": null, "defaultContent": "<button class='btn btn-s yellow-gold ajax-edit' data-toggle='modal' type='button'> 수정 </button>" }
],
"bStateSave": true, // save datatable state(pagination, sort, etc) in cookie.
"lengthMenu": [
[10, 20, 30, 40,50],
[10, 20, 30, 40,50] // change per page values here
],
// set the initial value
"pageLength": 10,
"pagingType": "bootstrap_full_number",
"order": [
[0, "asc"]
],
"createdRow": function (row, data, dataIndex) {
$(row).find('td:eq(12) button').attr('data-url', '/Product/GetProductEditForm/' + data["ProductID"]);
},
"initComplete": function() {
this.api().columns([1, 2, 3]).every(function() {
var column = this;
var select = $('<select class="form-control input-sm"><option value=""></option></select>')
.appendTo($(column.footer()).empty())
.on('change', function() {
var val = $.fn.dataTable.util.escapeRegex(
$(this).val()
);
console.log(val);
this.search(val).draw();
});
column.data().unique().sort().each(function (d, j) {
select.append('<option value="' + d + '">' + d + '</option>')
});
});
}
});
}
ありがとうございました。よく働く – superted