jQWidgets Forums

jQuery UI Widgets Forums Grid how to add a default date range for range filter

This topic contains 3 replies, has 2 voices, and was last updated by  Peter Stoev 10 years, 8 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author

  • rani
    Participant

    I have applied filtering as below:
    I ready function of grid i had called addDefaultfilter() method.But it is not filtering as expected and also the date range is not showed up in the date filter panel.
    here i need a range like 15/10/2014 – 21-210-2014 to be diaplayed as default in the filter panel when the grid loads.Can you help me in this.

    var addDefaultfilter = function () {
    var filtergroup = new $.jqx.filter();
    var filter_or_operator = 1;
    var filtervalue = ‘15/10/2014’;
    var filtercondition = ‘GREATER_THAN_OR_EQUAL’;
    var filter1 = filtergroup.createfilter(‘datefilter ’, filtervalue, filtercondition);

    filtergroup.addfilter(filter_or_operator, filter1);
    $(“#jqxGrid”).jqxGrid(‘addfilter’, ‘Status’, filtergroup);
    $(“#jqxGrid”).jqxGrid(‘applyfilters’);
    };
    $(“#jqxGrid”).jqxGrid(
    {
    showfilterrow: true,
    filterable: true,
    selectionmode: ‘multiplerowsextended’,
    ready: function () {
    addDefaultfilter();
    },
    columns:
    [
    { text: ‘Started’, datafield: ‘Started’, width: ‘18%’, editable: false, filtertype: ‘range’, cellsformat: ‘d’ }
    });

    Regards,
    rani.


    Peter Stoev
    Keymaster

    hi rani,

    jQWidgets works with JavaScript Date objects which means that filtervalue – String for Date column is unexpected filtering value and should not work.I would suggest you to use JavaScript Date objects.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com


    rani
    Participant

    Hi,

    I have done filtering based on javascript date for range filtering type but filtering is not working as expected.
    Please find the below link:
    http://jsfiddle.net/P7BCs/134/

    Here in this link default range filter is applied.But filtering is not done based on the date range given(10/11/2014 – 10/21/2014).All dates re displayed.
    I cant understand what is happening here.Can you please look in to this.

    Regards,
    rani.


    Peter Stoev
    Keymaster

    Hi rani,

    If you want to create a range, this means that one of your conditions should be greater than, the other should be less than. Ex: http://jsfiddle.net/mh17pjzx/

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.