Home > javascript > Number and a date range filter for datatable serverside script

Number and a date range filter for datatable serverside script

January 12Hits:2
Advertisement

I'm using Datatable (DataTables 1.10.10) and Datatable Editor. For my serverside script/table (500000 rows) I would like to have a number and a date range filter. As simple text filter is working fine. Where and how can I modify the 'data.php` for the range filter to work? That's my setup:

<html>      <input data-column="2" id="min" name="min" type="text">       <input data-column="2" id="max" name="max" type="text"> </html> 

my script:

 var table = $('#my-table').DataTable( {     dom: "Blfrtip",     ajax: {     url: "/myscript/data.php",     type: "POST",     data: function (d) {          d.minDate = $('#min').val();          d.maxDate = $('#max').val(); }      }, ... });  $('#min, #max').keyup( function() {     table.ajax.reload(); });  

Do I need to further define the values in .... data: function (d) { d.minDate = $('#min').val(); d.maxDate = $('#max').val(); } }, ... with sth like:

function( settings, data, dataIndex ) {     var min = parseInt( $('#min').val(), 10 );     var max = parseInt( $('#max').val(), 10 );     var id = parseFloat( data[6] ) || 0;       if ( ( isNaN( min ) && isNaN( max ) ) ||          ( isNaN( min ) && id <= max ) ||          ( min <= id   && isNaN( max ) ) ||          ( min <= id   && id <= max ) )     {         return true;     }     return false; } 

Related Articles

  • Number and a date range filter for datatable serverside scriptJanuary 12

    I'm using Datatable (DataTables 1.10.10) and Datatable Editor. For my serverside script/table (500000 rows) I would like to have a number and a date range filter. As simple text filter is working fine. Where and how can I modify the 'data.php` for th

  • SharePoint 2013 Date Range Filter on list using FilterFields and FilterOpsJuly 4

    I am working on a project in SharePoint 2013. Currently I am trying to implement list view filtering using OOTB QueryString parameters. I have found the following params have been working a treat when dealing with a single condition: FilterField1, Fi

  • SharePoint 2010 search with multiple keywords, wildcards and Date range filterOctober 26

    I want to accomplish the following tasks in SharePoint 2010 environment. I want the following function to be implemented in SharePoint 2010 search results. User can include the operators OR & AND in the search string. User can state the period for se

  • Customizing Date range filter for Google ChartJanuary 21

    I am facing issue while implementing ChartRangeFilter and CategoryFilter in google charts.I am plotting Line Chart with date range field on X axis. I have month and Year wise data hence I am trying to visualize data by using Month and Year Range Filt

  • Date range filter for manage posts list on edit.phpJanuary 28

    I need to add some custom submenu links to the Posts menu in WordPress admin so content managers can click on a link and get a list of posts from today, yesterday or this month. The default date filter in the WordPress back end filters posts by month

  • Date range filter without SPD or InfopathFebruary 27

    I am having a very difficult time trying to figure out how to create a page in SP2010 Enterprise that displays list items based on a user selected date range and status field is "approved" . Preferably using a pair of date pickers or a single da

  • Colorizing Excel cells with a date range filterJune 19

    In a table there is a number of column (chambre) and a number of row (alveole). If these matches in a list in an other sheet then it checks if it the date is between two dates on that second sheets. If it matches those 3 things, then it puts the shee

  • Date Range filtering using Google Search Appliance crashingSeptember 5

    I'm working with the Google Search Appliance and corresponding drupal module. I've followed the user guide linked on the project page (also here) on creating filters. I was hoping to create a date range filter, however, I'm a bit stumped on how to fi

  • aws-cli describe-instances, find by date rangeMarch 10

    Using the aws-cli client (https://github.com/aws/aws-cli), is there a way to find instances using a date range filter? Or using an "earlier than X date" or "last X days" filter? It seems that the only date-related filter is to specify

  • getting average number after data filter by date rangeApril 25

    I would like to get an average number of a data that has been filter by date range. however instead of getting the avg for display date range it calculate all the number in the database: ex: database: 1+2+3+4+5 after filter by date range: 1+3+5 Avg s

  • Jquery datatables: filter date range between two dates on multiple columns in codeigniter

    Jquery datatables: filter date range between two dates on multiple columns in codeigniterJanuary 28

    my date range with submit button didn't filter or display between two dates on multiple columns in jquery datatables using json and ajax. I want to filter or display date range between two dates with the date format of yyyy-mm-dd on multiple columns

  • Codeigniter: filter date range between two dates on multiple columns in jquery datatables

    Codeigniter: filter date range between two dates on multiple columns in jquery datatablesJanuary 29

    My date range with submit button didn't filter or display between two dates on multiple columns in jquery datatables using json and ajax. I want it to filter or display date range between two dates with the date format of yyyy-mm-dd on multiple colum

  • How can I filter a view by date ranges from another content type?February 16

    I am building a site in Drupal 7 that has a list of events. I would like to be able to filter these events by specific date ranges from another content type. I have successfully been able to set up a view that enables users to filter the list of even

  • filter sharepoint 2007 search results by date range?January 4

    i want to filter the sharepoint2007 search results by given date range. I.e., With in a day With in a week With in a month With in a year Is it possible? If so, please help. --------------Solutions------------- I've used methods described in this art

  • Django database query: How to filter objects by date range?January 12

    I've got a field in one model like class Sample(models.Model): date = fields.DateField(auto_now=False) Now, I need to filter the objects by a data range, for example, all the objects that has date between 1 Jan 2011 to 31 Jan 2011? Thanks for your he

  • Excel 2010 pivot table/chart - how to filter a date range without empty rows

    Excel 2010 pivot table/chart - how to filter a date range without empty rowsApril 11

    I have an Excel 2010 PivotTable pointed to some data in the workbook that includes a date. I can group the date field into year and month just fine. What I want to do is produce a chart of a filtered date range (e.g. the previous 12 months). However,

  • Drupal 7: Filter nodes with a date range arround an exposed date

    Drupal 7: Filter nodes with a date range arround an exposed dateJuly 12

    My issue is somewhat opposite of the common "List nodes within a date range". So, I have an Event content type, with fields start_date and end_date. They show when the event starts, and when the event ends. Now I need to be able to select a date

  • SUMIF date range and filter by value on Google Spreadsheet

    SUMIF date range and filter by value on Google SpreadsheetAugust 2

    How do I SUMIF two date ranges and filter with a value? The date range formula I've been using is: =sumif($A:$A,"<="&D$5,$C:$C)-sumif($A:$A,"<"&D$4,$C:$C) Which works great for summing all values within column C. But as m

  • Apachesolr search results Facet Filter by date range

    Apachesolr search results Facet Filter by date rangeSeptember 5

    I am using apache solr search with my drupal 6 website and seek a modification in the facets being displayed. Instead of the yearly facets like this: to somewhat like this: last hour last 24 hours last week last month last year I found http://searchh

  • count the number of times a substring is found within a date range in excelDecember 18

    I have a spreadsheet that contains test data. column A has the test name and column B contains the test date. I want to count the number of times that the string Rerun is found within a certain date range. For example A B test1 11/2/2012 test2 11/7/2

Copyright (C) 2018 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 14 q. 1.235 s.