jQWidgets Forums

jQuery UI Widgets Forums Grid time Range in grid

This topic contains 3 replies, has 2 voices, and was last updated by  Hristo 9 years, 5 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • time Range in grid #80480

    Dave_1
    Participant

    Hello,

    Can anyone help me i want to add time range filter in grid.
    and also print value of date range filter column in label.

    time Range in grid #80485

    Hristo
    Participant

    Hello Dave_1,

    We have similar theme:
    http://www.jqwidgets.com/community/topic/jqxgrid-date-filter/
    and especially this demo: http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/filtering.htm?web
    About how to print information could use getfilterinformation method from Grid.
    http://jsfiddle.net/jqwidgets/uyvqL/

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com

    time Range in grid #80487

    Dave_1
    Participant

    Thanks Hristo

    am facing problem in jqxRangeSelector .
    i have two columns start time and end time and i want to perform filter on it , it is not returning any value to grid.

    
                $("#rangeSelector").jqxRangeSelector({
    				width: 750, height: 100, min: data.StartTime, max: data.EndTime, range: { from: data.StartTime, to: data.EndTime },
    				majorTicksInterval: { hours: 4 }, minorTicksInterval: { minutes: 30 }, labelsFormat: 'hh:mm tt', markersFormat: 'hh:mm tt'
    
                });
    					    var applyFilter = function (from, to) {
    			                $("#jqxgrid1").jqxGrid("clearfilters");
    			                filtertype = "datefilter";
    			                var filtergroup = new $.jqx.filter();
    			                var filter_or_operator = 0;
    			                var filtervalueFrom = from;
    			                var filterconditionFrom = "GREATER_THAN_OR_EQUAL";
    			                var filterFrom = filtergroup.createfilter(filtertype, filtervalueFrom, filterconditionFrom);
    			                filtergroup.addfilter(filter_or_operator, filterFrom);
    			                var filtervalueTo = to;
    			                var filterconditionTo = "LESS_THAN_OR_EQUAL";
    			                var filterTo = filtergroup.createfilter(filtertype, filtervalueTo, filterconditionTo);
    			                filtergroup.addfilter(filter_or_operator, filterTo);
    			                $("#jqxgrid1").jqxGrid("addfilter", "StartTime", filtergroup);
    			                $("#jqxgrid1").jqxGrid("applyfilters");
    			            };
    			            // update filter on "change" event.
    			            $("#rangeSelector").on("change", function (event) {
    			                var range = event.args;
    			                var min = $("#rangeSelector").jqxRangeSelector("min");
    			                var max = $("#rangeSelector").jqxRangeSelector("max");
    			                min = new Date(min);
    			                max = new Date(max);
    			                if (range.from.getTime() == min.getTime() && range.to.getTime() == max.getTime()) {
    			                    $("#jqxgrid1").jqxGrid("clearfilters");
    			                } else {
    			                    applyFilter(range.from, range.to);
    			                };
    			            });
    
    time Range in grid #80547

    Hristo
    Participant

    Hello Dave_1,

    Please take a look this demo:
    http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/filterrow.htm?arctic
    (in column ‘Ship Date’ you could see this functionality)

    Best Regards,
    Hristo Hristov

    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.