さまざまな列と検索ボックスを備えたこのテーブルがあります。
日付値を持つ列の場合、検索ボックスでdatepicker jsを使用します。他の列の代わりに、Datatable のデフォルトの検索ボックスを使用します。
日付の範囲またはテキストだけで、検索を多様化する必要があります。しかし、検索方法はユニークなようで、異なる実装を持つことはできません。
ありがとう。
私はこの状況を持っています:
$(.datepicker, this.footer()).on('apply.datepicker',function (ev,picker){
$(this).val(picker.startDate.format(picker.startDate.format('DD/MM/YYYY') + '|' + picker.endDate.format('DD/MM/YYYY');)
if(that.search() !== (picker.startDate.format('DD/MM/YYYY') + '|' + picker.endDate.format('DD/MM/YYYY'))){
that.search(picker.startDate.format('DD/MM/YYYY') + '|' + picker.endDate.format('DD/MM/YYYY')).draw();
}
}
と
$( 'input', this.footer() ).on( 'keyup change', function () {
if ( that.search() !== this.value ) {
that
.search( this.value )
.draw();
}
}
