Author Topic: Date Filter On Toolbar  (Read 1111 times)

Sivakumar

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 32
    • View Profile
Date Filter On Toolbar
« on: February 19, 2021, 06:55:43 pm »
Hi,

I have a requirement where I need to have a date filter on the toolbar.

The date filter will open up like a calendar from where I will be able to select FromDate and ToDate locally.

Attached a screenshot to give a picture of the requirement.

Let me know if more input will be required from my end on this.

Thank you.


paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Date Filter On Toolbar
« Reply #1 on: February 22, 2021, 02:30:15 pm »
Please take help of API.

https://paramquery.com/pro/api#option-toolbar

https://paramquery.com/pro/api#method-filter

Code: [Select]
    toolbar: {
      items: [{
          type: 'textbox',
          cls: 'od1',
          init: function(node){
          $(node).datepicker();
          }
        },
        {
          type: 'textbox',
          cls: 'od2',
          init: function(node){
          $(node).datepicker();
          }
        },
        {
          type: 'button',
          label: 'Filter',
          listener: function() {
            this.filter({
            rules:[
              {dataIndx:'OrderDate', condition:'between', value: $('.od1').val(), value2: $(".od2").val() }
              ]
            })
          }
        }
      ]
    }