Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:
managing jquery in wordpress
Scroll to last inserted record
Hi,
I am looking for a proper way to scroll to the last inserted record. Is there a way to archive this?
I have tried to use scroll.to() but it dont work.
Thanks for any advice
Arga
Заметка N65 : Учебное пособие и обучающие видео по покеру
Если Вас интересуют гибкие условия игры, то будьте уверены - здесь Вы найдете то, что искали. Вы не теряете право хода если игрок перед вами пропустил ход, это происходит только в случае, если вы не предприняли действий, когда по правилам была ваша очередь ходить. В то же время более опытные игроки приходят сюда чтобы получить максимум возможного профита с фишей.
На некоторых из этих покер-румов вы даже можете играть в покер с помощью браузера, не закачивая никаких дополнительных покерных программ. Поэтому для того, чтобы выделить топ лучших казино онлайн, необходимо учитывать несколько важных критериев, определяющих их место в рейтинге по честности.
В такой перспективе профессиональное сообщество должно обладать определенным набором признаков, которые позволяют его очертить. Либо он сбрасывает карты: он бросает свои карты и поэтому объявляет себя проигравшим.
Кроме того, игроки сами могут выставлять себе лимиты на депозиты, если знают, что не могут контролировать свою игорную зависимость. Еще один фактор, который следует учитывать игрокам в онлайн-покер, - это выбор предлагаемых онлайн-покерных игр.
Смотрите по ссылке <a href="https://poker-match.net/">на сайте</a>
Персонализированные параметры для кредитных карт
Относительно новый рост покера не был напрасным: в течение нескольких лет игра стала модой, что привело игроков в частые игровые круги, чтобы предаться своей практике. Качественная поддержка - на письменные запросы отвечает довольно оперативно (в течение нескольких часов), при этом есть возможность связаться со специалистами по бесплатным номерам.
Например, издания Алана Скунмейкера. Для того, чтобы скачать бесплатно Fulltiltpoker с официального сайта, в первую очередь, российским пользователям необходимо обойти блокировку покер-рума.
Анализ различных видов патологических поведенческих зависимостей показывает, что, как правило, в их основе лежит нарушение влечения, нарушение какого-то из врожденных инстинктов. Как я уже упоминал, хотя игральные карты с 54 различными рисунками не очень полезны для серьезной игры в бридж, они доставляют большое удовольствие, играя с детьми.
Статья N12 про обзоры онлайн-казино
Одно положительное: в Sports Interaction никогда не бывает скучно. Во время поездки в ее штаб-квартиру в Лас-Вегасе, чтобы узнать больше о ее планах, я вскоре обнаружил, на что может быть похож мир, если распознавание лиц происходит повсюду. Во время игровых сессий с живым вендором все они обучены.
Разве вы не хотели бы, чтобы каждый из них был так же хорош, как тот, который вы найдете здесь, в казино Conquer? Огромное количество денег. Каждому участнику разрешено зарегистрировать не более трех кредитных карт, и каждая может вносить на депозит не более 3500 долларов в день.
<a href="https://flcgardencity.info/interesnye-facty-o-kazino/top-10-kazino-samye-bogatye-igroki-v-poker/">https://flcgardencity.info/interesnye-facty-o-kazino/top-10-kazino-samye-bogatye-igroki-v-poker/</a - здесь Вы найдете актуальную информацию
После того, как вы примете участие, вы окажетесь зависимым от видеоигр в мобильном казино. Наслаждайтесь нашей коллекцией слотов, настольных игр, видео-покера, скретч-карт и многого другого! Вы будете накапливать баллы, после чего их можно обменять на бесплатные вещи, сравнимые с бесплатной игрой, парковкой камердинером, едой и напитками и так далее.
Было бы лучше убедиться, что, если вы платите членский взнос, вы регистрируетесь в казино с чрезмерными выплатами, а не в легком «дворовом» казино с низкими или умеренными выплатами. Они должны быть у входа дилера, чтобы принять участие в блэкджеке. Я полагаю, что актеры Бонда похожи на сериалы Saturday Night Live и коллекцию Star Trek - вы, возможно, восхититесь другими, но ваш любимый фильм всегда будет тем, за которым вы выросли. На Paddy Power вы найдете и другие приветственные подарки, депозиты на матчи казино, бесплатные и дополнительные бонусы.
Стоит ли играть в игровые автоматы, когда в современном казино существует так много других игр? Мы являемся подтвержденным штатом опытных производителей видеоигр / игр для ноутбуков.
Заметка N73 про зеркало казино
Эта акция строго ограничена, по крайней мере, одним новым участником на домохозяйство, даже если у нее есть пара компьютеров. По мере того, как игра становится все более популярной, онлайн-казино предпринимают необходимые шаги для привлечения новых клиентов и удовлетворения лояльных игроков. Турнир Heartle Groundhog Slam Pickball уже начался!
Вы можете играть в азартные игры и просто увидеть, насколько вам повезло, или вы можете просто заняться спортом и получить удовольствие. Большинству нравится играть в покер, dominoqq, рулетку, многие другие виды спортивных игр в казино, которые действительно являются дополнительным критерием путешествия. В то время как некоторые сайты могут ограничивать это предложение как приветственный бонус, другие расширяют его, чтобы включить ряд рекламных акций.
<a href="https://flcgardencity.info/kazino/sovety-dlja-igry-v-kazino-nachinajuschim-igrokam/">перейти</a> перейдите и получите нужную Вам информацию
Сингх, который также является членом Мичиганского университета по травматологии и Института политики и инноваций в сфере здравоохранения. Вы получите дополнительный опыт и узнаете новые трюки от профессиональных геймеров. Человек может без проблем взять на себя большую часть ставок онлайн видеоигр на нескольких веб-сайтах, не рискуя выходить на улицу.
Еженедельные бонусы включают 50 бесплатных вращений в определенном слоте, тогда как бонус Weekend Reload составляет 50% до 700 евро, что обычно может сопровождаться 50 бесплатными вращениями. Интернет-казино были разработаны как другой способ развлечься с коллегами или просто развлечься, когда вам скучно дома. Игроки не воспринимают эти виды спорта как небольшую ставку между двумя своеобразными казино, но они также играют с одинаковым строгим подходом, поскольку есть возможность получения кредитов и очков, которые геймеры могут получить в своих платежах и использовать их в платных казино, чтобы сделать то хорошее Деньги. Узнать больше о легализации разных видов игорного бизнеса вы сможете на Kyiv iGaming Affiliate Conference, которая состоится 18 декабря.
Вам нужно будет отыграть определенную сумму в долларах раньше, чем вы сможете обналичить бонусные деньги. Казино Украины, заслуженно попавшие на верхушку рейтингов, гарантируют посетителям безопасность, предоставляя качественную техподдержку.
Styling for Editor execute buttons when using in-table form controls and Bootstrap 4?
Greetings.
I'm setting up an Editor that uses both the standard New/Edit/Delete buttons at the top of the table, and also in-table form controls -- with the Bootstrap 4 styling.
The buttons at the top of the table work perfectly, launching an Editor that has execute buttons at the bottom of the modal page with proper Bootstrap classes ("btn btn-primary" and "btn btn-danger"). That means proper Bootstrap buttons are displayed.
The Editors launched by the in-table form controls, however, have execute buttons at the bottom of the modal with classes of just "btn" -- which results in unstyled buttons in Bootstrap, though they function properly.
This is using the exact code on the page at https://editor.datatables.net/examples/simple/inTableControls.html
// Edit record
$('#example').on('click', 'a.editor_edit', function (e) {
e.preventDefault();
editor.edit( $(this).closest('tr'), {
title: 'Edit record',
buttons: 'Update'
} );
} );
// Delete a record
$('#example').on('click', 'a.editor_remove', function (e) {
e.preventDefault();
editor.remove( $(this).closest('tr'), {
title: 'Delete record',
message: 'Are you sure you wish to remove this record?',
buttons: 'Delete'
} );
} );
If I modify that code to add a label and className to the "buttons" line, it does create a button with the correct Bootstrap class -- but the Editor form won't submit. Clicking on the button does nothing, and no JavaScript errors are logged.
Here are my modifications:
// Edit record
$('#example').on('click', 'a.editor_edit', function (e) {
e.preventDefault();
editor.edit( $(this).closest('tr'), {
title: 'Edit This Record',
buttons: [{label: 'Edit', className: "btn-primary"}]
} );
} );
// Delete a record
$('#example').on('click', 'a.editor_remove', function (e) {
e.preventDefault();
editor.remove( $(this).closest('tr'), {
title: 'Delete This Record',
message: 'Are you sure you wish to remove this record?',
buttons: [{label: 'Delete', className: "btn-danger"}]
} );
} );
I've experimented with adding extend: "create", extend: "remove", and editor: editor, to the "buttons: " lines, but this has no effect.
How can I add the Bootstrap classes to the execute buttons and still have the Editor form submit properly?
Many thanks!
hints for a better "search experience" with server side processing
Dear community,
i benefit so much from this forum. Time to give something back.
With the default settings in the SQL helper functions (ssp.class.php) the search experience is pretty poor compared
with the great smart search on client side processing.
Just want to share some hints:
* create a fulltext index in your SQL table. Edit the SQL executions and add boolean mode in ssp.class.php. Tried to explain it here roughly.
* modificate the search string in ssp.class.php per Regex
$str = $request['search']['value'];
//remove leading boolean operators and the trailing last character, if they are just typed in and "alone" with any trailing any other characters
//this is primary for avoiding SQL/json fault messages
//e.g. "+search1 +" --> "+search"
//e.g. "-search1 + > ( +search2 <" --> "-search1 +search2"
//https://stackoverflow.com/questions/7660545/delimiter-must-not-be-alphanumeric-or-backslash-and-preg-match#comment104798716_7660545
//https://www.phpliveregex.com/p/vzy#tab-preg-replace
$str = preg_replace('/[\+\-\>\<\(\)\~][^\w]|\+$/', '', $str);
//$str2 = preg_replace('/\b.{1,3}\b\s?/', '', $str);
//add a wildcard to the end of each word with a length of more than 3
//e.g. "it is more than a search" -> "it is more* than* a search*"
//https://stackoverflow.com/a/40614597
//https://www.phpliveregex.com/p/vzz#tab-preg-replace
$str = preg_replace('/\b\w{3,}\b/', '$0*', $str);
//add a leading '+' to all search terms without a leading boolean
//e.g. "+search1 -search2 search3 ~search4" -> "+search1 -search2 +search3 ~search4"
//remark; this will convert the search into a boolean AND - a boolean OR will not anymore
//https://www.phpliveregex.com/p/vzF
$str = preg_replace('/([^\+\-\>\<\(\)\~])(\b\w+\b)/', ' +$2 ', $str);
$binding = self::bind( $bindings, '%'.$str.'%', PDO::PARAM_STR );
$globalSearch[] = "match(myFullTextColumn) against (".$binding." in boolean mode)";
With this adaptation you will almost get the same (smart) search as like with client side processing.
The only thing i was not able to was figuring out how to operate with a leading wildcard *mysearch.
I am afraid, this is not been supported by the fulltext search in SQL.
Regards..
Button or New to search json object to create new rows into table
I'm using editor where I have a "USERS" table. I want to make sure the username matches exactly what is in our windows active directory. So I was thinking, from the "USER" table, the client could click on the "NEW" button or perhaps "link to Windows AD" button for a new user that is not in the "USERS" table yet, which would open a new modal containing another DataTables. It would be a separate ajax call that gets the windows active directory info such as username, full name, and email. The end user could then quickly search this table, click to add who they want to link the Windows Active Directory account over the "USER" table.
So far, I have able to collect all of the Windows Active Directory information, but I'm stuck on how to make a button or use the "NEW" button to load this json information into a table that is searchable, to then quickly add that to the USERS table. Is there any examples of this anywhere I could use to start this?
How to display a running total of an amount entered into the table?
http://live.datatables.net/dalogaci/1/edit
I have an amount of money to be dispersed. I want to provide a running total of the amount entered into the table please so I can warn when the total to be dispersed has been reached or passed.
Kind regards,
Glyn
Alphabet index search - vertical?
Hi -
I've implemented the Alphabet Index search as described in the blog, and it works quite nicely.
One of my users has asked for a way to render the list vertically, similar to how Plex works.
Any thoughts on how I can do this?
Can not trigger column(s) visibility.
Fairly new to all of this so patience and help appreciated.
I have a table working, as well as this code here:
$('#leadTable').on( 'length.dt', function ( e, settings, len ) {setTimeout(bindME,2000);});
$('#leadTable').on( 'page.dt', function () {setTimeout(bindME,1000);});
What I am wanting to do is a create an event that upon clicking an element, hide columns 6,7,8,9 in my table.
I tried the example code on this page - https://datatables.net/examples/api/show_hide.html
But I seem to get nowhere. I have a variable for my table called "tommy" -
`
var tommy = $("#callsTable").dataTable({
searchPane: {
columns: [':contains("Market")'], threshold: 0
},
"order": [],
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
"columnDefs": [
{ "visible": false, "targets": 9, "searchable": true, "orderable": true },
{ "visible": false, "targets": 10, "searchable": true, "orderable": true },
{ "visible": false, "targets": 11, "searchable": true, "orderable": true },
{ "visible": false, "targets": 12, "searchable": false, "orderable": false }
//{ "visible": false, "targets": 15 },
// { "visible": true, "targets": 0, "searchable": true }
],
"language": {
"lengthMenu": "_MENU_ Rows",
"searchPlaceholder": "Search Client Leads",
"info": "Rows _START_ to _END_ of _TOTAL_"
},
"oLanguage": {
"sSearch": "<i class='fal fa-search fa-1ax'></i>"
},
//colReorder: true,
dom: "<'#cLeads.row be-datatable-header'lfBi>" +
"<'row be-datatable-body'<'col-sm-12'tr>>" +
"<'row be-datatable-footer'<'col-sm-12'p>>",
buttons: [
{ extend: 'colvis', text: 'Columns' },
{
extend: 'collection',
text: 'Export',
buttons: [
'excel',
'csv',
'pdf',
'print'
]
}
]
});
`
But this code gets me nowhere
$('a.toggle-vis').on( 'click', function (e) {
e.preventDefault();
// Get the column API object
var column = tommy.column( $(this).attr('data-column') );
// Toggle the visibility
column.visible( ! column.visible() );
} );
Populating the table with RAWSQL query
I am using the raw sql query below to populate some columns in the datatble which is already created using Editor data-tables. I am not sure if I am doing it correctly. I believe that the** if ( ! isset( $_POST['action'] ) ) {** is not working as it should work.
How should the JSON response look like?
In my case I would like JSON to contain all the data 1) From RAW sql to populate few columns and 2) From Editor to populate renaming columns (else condition).
p.s i tried to remove the if condition so i can read all the data in one JSON and then handle them differently on client side but it is showing me** Error: Parse error**
**// if ( ! isset( $_POST['action'] ) ) {
$rawquery = "SELECT start AS time
FROM contract_bal";
$data = $db->sql( $rawquery )->fetchAll();
echo json_encode( array(
'data' => $data
) );
// }else{
......editor stuff
}**
and on the client side i included this:
**columns[
......
{ data: "time" }
.....
]**
Change Search Pane modal background?
Hi,
I'm using searchPanes button to open searchPanes modal.
When modal opens, its background is transparent and I can see all the objects under it (only cascade panes are not transparent but everything else yes).
I can't understand why, but I don't know how to change this attribute.
Datatables error on editor error from server.
I am using Editor with inline edit with the help of KeyTable. It is working well in case of success from the server, but in case of error, I get error in js, picture is attached.
and Everything stop working after this.
My code for the keyTable is: keys: {
columns: notEditableColumns,
keys: [9],
editor: editor,
editOnFocus: true
},
select: {
style: 'os',
selector: 'td:first-child'
},
Scroller 2.0.2 doesn't work properly with Search Panes
Link to test case:
https://codepen.io/MadBoyEvo/pen/dyMNypY
If you change scrollerr to 2.0.1 it works fine
Debugger code (debug.datatables.net):
Error messages shown:
jquery-3.5.1.min.js:2 jQuery.Deferred exception: Cannot read property 'scroller' of null TypeError: Cannot read property 'scroller' of null
at HTMLTableElement.<anonymous> (https://cdn.datatables.net/scroller/2.0.2/js/dataTables.scroller.min.js:26:93)
at HTMLTableElement.dispatch (https://code.jquery.com/jquery-3.5.1.min.js:2:43090)
at HTMLTableElement.v.handle (https://code.jquery.com/jquery-3.5.1.min.js:2:41074)
at Object.trigger (https://code.jquery.com/jquery-3.5.1.min.js:2:71513)
at HTMLTableElement.<anonymous> (https://code.jquery.com/jquery-3.5.1.min.js:2:72108)
at Function.each (https://code.jquery.com/jquery-3.5.1.min.js:2:2976)
at S.fn.init.each (https://code.jquery.com/jquery-3.5.1.min.js:2:1454)
at S.fn.init.trigger (https://code.jquery.com/jquery-3.5.1.min.js:2:72084)
at t (https://nightly.datatables.net/js/jquery.dataTables.min.js:77:155)
at S.fn.init.za (https://nightly.datatables.net/js/jquery.dataTables.min.js:73:1) undefined
S.Deferred.exceptionHook @ jquery-3.5.1.min.js:2
jquery-3.5.1.min.js:2 Uncaught TypeError: Cannot read property 'scroller' of null
at HTMLTableElement.<anonymous> (dataTables.scroller.min.js:26)
at HTMLTableElement.dispatch (jquery-3.5.1.min.js:2)
at HTMLTableElement.v.handle (jquery-3.5.1.min.js:2)
at Object.trigger (jquery-3.5.1.min.js:2)
at HTMLTableElement.<anonymous> (jquery-3.5.1.min.js:2)
at Function.each (jquery-3.5.1.min.js:2)
at S.fn.init.each (jquery-3.5.1.min.js:2)
at S.fn.init.trigger (jquery-3.5.1.min.js:2)
at t (jquery.dataTables.min.js:77)
at S.fn.init.za (jquery.dataTables.min.js:73)
Description of problem:
Tried adding Search Panes and upgrading libs at the same time. Using following js
"https://nightly.datatables.net/js/jquery.dataTables.min.js"
"https://cdn.datatables.net/autofill/2.3.5/js/dataTables.autoFill.min.js"
"https://cdn.datatables.net/buttons/1.6.3/js/dataTables.buttons.min.js"
"https://cdn.datatables.net/buttons/1.6.3/js/buttons.colVis.min.js"
"https://cdn.datatables.net/buttons/1.6.3/js/buttons.html5.min.js"
"https://cdn.datatables.net/buttons/1.6.3/js/buttons.print.min.js"
"https://cdn.datatables.net/colreorder/1.5.2/js/dataTables.colReorder.min.js"
"https://cdn.datatables.net/fixedcolumns/3.3.1/js/dataTables.fixedColumns.min.js"
"https://cdn.datatables.net/fixedheader/3.1.7/js/dataTables.fixedHeader.min.js"
"https://cdn.datatables.net/keytable/2.5.2/js/dataTables.keyTable.min.js"
"https://cdn.datatables.net/responsive/2.2.5/js/dataTables.responsive.min.js"
"https://cdn.datatables.net/rowgroup/1.1.2/js/dataTables.rowGroup.min.js"
"https://cdn.datatables.net/rowreorder/1.2.7/js/dataTables.rowReorder.min.js"
"https://cdn.datatables.net/scroller/2.0.2/js/dataTables.scroller.min.js"
"https://cdn.datatables.net/searchpanes/1.1.1/js/dataTables.searchPanes.min.js"
"https://cdn.datatables.net/select/1.3.1/js/dataTables.select.min.js"
"https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.24.0/moment.min.js"
"https://cdn.datatables.net/plug-ins/1.10.20/sorting/datetime-moment.js"
Also if you click on Search Panes button in 1st table the pane isn't displayed properly.
Triggering export after table is redrawn to show all records
Hello all,
I have datatables set up to use server side processing and as we all know, if you click export it will only export what it has in memory. This makes perfect sense, however I need the ability to export all rows. I know there are various other questions about this, and other ways to solve it, however I am interested in try to automatically change the page length to 'All' when the user clicks the export button.
i.e.:
"buttons":
[
{
extend: "edit",
editor: editor
},
{
extend: 'excel',
text: 'Export to Excel',
action: function ( e, dt, node, config ) {
theTable.page.len(-1).draw();
theTable.button('1').trigger();
}
}
]
The above throws a Stackoverflow (which I think makes some sense as it looks like an endless loop). Long story short how do I (or can I?) change the action of the excel export to first change the page length to 'All' then export the data? I can always instruct my users to manually select 'All' then export, but they won't listen.
I have also tried:
"buttons":
[
{
extend: "edit",
editor: editor
},
{
extend: 'excel',
text: 'Export to Excel',
action: function ( e, dt, node, config ) {
theTable.page.len(-1).draw();
$.fn.dataTable.ext.buttons.excelHtml5.action.call(this, e, dt, node, config);
}
}
]
Which 'works' in that it does export the data but it doesn't wait for the draw to complete which means it only exports the first page. Is there anyway to have the $.fn.dataTable.ext.buttons.excelHtml5.action.call(this, e, dt, node, config);
wait until after the draw completes?
Thoughts?
How do you show select inputs filtering drop down bar for columns that are hidden by default?
Hello, I'm very new to datatables and coding for that matter so please forgive my writing and terminology. I'm still learning. I have been trying my best to put together an in depth filtering library for a school district resource project for the community through all the examples everyone has provided. So far I have: https://codepen.io/mmapsesd/pen/NWNbOLj
I have a bunch of columns that doesn't need to be initially be displayed so I was able to hide it with:
columnDefs: [
{targets:[4,5,6,7], visible: false
However now when I turn these columns back on to be visible within the 'Colvis" toolbar, the columns no longer have the individual column searching select input. It just displays the header title again instead of the drop down. How do I fix this?
Lastly is there also a way to display my "Features" column to be wrapped (on multiple lines within a smaller column) vs 1 long line (wide column) and is there a way to have the individual column searching select input to just recognize and show the hyperlink in the drop down list versus the whole entire paragraph? Thank you so much for your help!
Issues with Ajax array of objects
Link to test case: http://dkoy.org/ql/index.html?guild=active%20players&server=GLOBAL
Debugger code (-): https://debug.datatables.net/ojuwuc
Error messages shown: DataTables warning: table id=example - Requested unknown parameter '0' for row 0, column 0. For more information about this error, please see http://datatables.net/tn/4
Description of problem:
I am fairly new to js and JSON and have been smashing my face against this trial-and-error style for 2 nights and it's time to concede and ask for assistance. I feel like my raw JSON is formatted similarly to the example on https://datatables.net/examples/ajax/objects. The correct number of rows are being returned but I am receiving the above error. I am able to log the returned json to the console and access individual attributes using:
table.on( 'xhr', function () {
var json = table.ajax.json();
console.log(json);
console.log(json.heroPlans[0].id);
alert( json.heroPlans.length +' row(s) were loaded' );
} );
Here is the js
var table = $('#example').DataTable({
"ajax": {
"url": "js/guild_plan.json" + "?server=" + server + "&guild=" + guild,
"dataSrc": "heroPlans",
},
columns: [
{"heroPlans": "id"},
{"heroPlans": "name"},
{"heroPlans": "heroPower"},
{"heroPlans": "health"},
{"heroPlans": "battleEventMulti"},
{"heroPlans": "row1Bonus"},
{"heroPlans": "row2Bonus"},
{"heroPlans": "row3Bonus"},
{"heroPlans": "row4Bonus"}
],
paging: false,
});
Here is a sample of the JSON
{
"guildId": 52073,
"name": "ACTIVE PLAYERS",
"heroPlans": [{
"id": 1876241,
"name": "SIRSARGE",
"heroPower": 3940131,
"health": 1073890,
"attack": 1276726,
"defense": 762637,
"magic": 826878,
"battleEventMulti": 0.0,
"row1Bonus": null,
"row2Bonus": null,
"row3Bonus": null,
"row4Bonus": null
}, {
"id": 2073569,
"name": "ODDPANDA",
"heroPower": 3138061,
"health": 856366,
"attack": 979995,
"defense": 614617,
"magic": 687083,
"battleEventMulti": 0.0,
"row1Bonus": null,
"row2Bonus": null,
"row3Bonus": null,
"row4Bonus": null
}
...
}
Thanks much in advance
When will the "Search Builder" manual appear?
Hello, tell me when will the manual for "Search Builder" appear?
How to refresh when I select a date
my datatables codes are
var table;
$(document).ready(function() {
table= $('#example').DataTable({
"applyFilter":true,
"processing" : true,
"select":false,
"ajax" : {
"url" : "http://localhost:3000/zamansecimi2",
dataSrc : 'data'
},
"columns" : [ {
"data" : "id"
}, {
"data" : "mac"
},{
"data" : "x"
},{
"data" : "y"
},{
"data" : "oncekizaman",
type: 'datetime',
def: function () { return new Date(); }
},{
"data" : "zaman",type: 'datetime',
def: function () { return new Date(); }
}
]
})
});
minDateFilter = new moment($('#bas').val())
maxDateFilter = new moment($('#bit').val())
var startDate = minDateFilter,
endDate = maxDateFilter;
$.fn.dataTableExt.afnFiltering.push(
function( settings, data, dataIndex ) {
const format2 = "YYYY-MM-DD"
var min = moment(minDateFilter).format(format2);
var max =moment(maxDateFilter).format(format2);
var createdAt = data[4] || 0; // Our date column in the table
var dateTime2 = moment(createdAt).format(format2);
//createdAt=createdAt.split(" ");
var startDate = min;
var endDate = max;
var diffDate = dateTime2;
console.log(dateTime2);
if (
(min == "" || max == "") ||
(
//diffDate.isBetween(startDate, endDate)
moment(diffDate).isSameOrAfter(min) && moment(diffDate).isSameOrBefore(max))
) { return true; }
return false;
}
);
// Date range filter
function getir(){
location.reload();
}
$('.date-range-filter').change( function(e) {
table.draw();
});
my html codes are
<div class="input-daterange">
<label for="start">Başlangıç</label>
<input type="date" name="bas" id="bas" placeholder="" >
</div>
<div class="form-group">
<label for="end">Bitiş</label>
<input type="date" name="bit" id="bit" placeholder="" >
</div>
<input class="button" type="button" value="Raporu Getir" id="filter" onclick="getir();"/></input>
When I select date from datepicker it is not refreshing the table.why?how can I fix my problem?
thank you for your help