jQWidgets Forums

Forum Replies Created

Viewing 10 posts - 16 through 25 (of 25 total)
  • Author
    Posts

  • nja
    Participant

    Thank you. Working through a particularly difficult bug fix and just wanted to make sure I had all my ducks in a row.

    thanks,
    nja


    nja
    Participant

    Hey there,
    I read that topic. I am asking for clarification of the documentation and to verify that I have understood the documentation correctly.

    Again, as I understand it using updatebounddata with the ‘cells’ parameter should not cause the filters to reset. Is that correct?

    thanks,
    nja


    nja
    Participant

    Hi Dimitar,
    I realize it was 3rd party, was just hoping some had done work like that.

    Your controls are great, but I was looking to do “math” inside the cells.

    Thank you for your time to respond. I am sure I speak for everybody, we appreciate you guys staying on top of the forum posts.

    Thanks,
    nja

    in reply to: "stacking" filters for a grid "stacking" filters for a grid #70501

    nja
    Participant

    After working with Dimitar, I did a little code clean up, then to address the UI issue I am using the $(‘#jqxgrid’).jqxGrid(‘showloadelement’); and then hiding it after the process has completed, lastly I added a pause to the code using setTimeout() to allow the gif to show.

    It’s not intuitive, but adding a few more seconds to the whole process creates a better user experience.

    The code now looks like this…
    =========================================================

                $("#jqxCategoryWidget").on('checkChange', function (event) {
                    //$("#filterByColorToolTip").jqxTooltip("open");
                    addfilter(event);
    
                });
    
                var addfilter = function (event) {
                    // build the filter
                    var itemLabel = event.args.value;
                    var filtergroup = new $.jqx.filter();
                    var filter_or_operator = 1;
                    var filtertype = 'stringfilter';
                    var filtervalue = itemLabel;
                    var filtercondition = 'contains';
    
                    var checkedItems = $("#jqxCategoryWidget").jqxListBox('getCheckedItems');
                    if (checkedItems.length == 0) {
                        $("#filterByColorToolTip").jqxTooltip("open");
                        $('#jqxgrid').jqxGrid('showloadelement');
    
                        setTimeout( function() {
                            // code that must be executed after pause
                            $('#jqxgrid').jqxGrid('removefilter', 'HexColor');
                            $('#jqxCategoryExpander').jqxExpander('collapse');
                            $('#jqxgrid').jqxGrid('hideloadelement');
    
                        }, 2000 );
    
                    }
                    else {
                        for (var i = 0; i < checkedItems.length; i++) {
                            var filter_or_operator = 1;
                            var filtervalue = checkedItems[i].label;
                            var filtercondition = 'equal';
                            var filter = filtergroup.createfilter(filtertype, filtervalue, filtercondition);
                            filtergroup.addfilter(filter_or_operator, filter);
                        }
    
                        // add the filters.
                        $("#jqxgrid").jqxGrid('addfilter', 'HexColor', filtergroup);
                        // apply the filters.
                        $("#jqxgrid").jqxGrid('applyfilters');
    
                    }
    
                }
    
                var removefilter = function () {
                    $('#jqxgrid').jqxGrid('showloadelement');
                    setTimeout( function() {
                        // code that must be executed after pause
                        $("#jqxCategoryWidget").jqxListBox('uncheckAll');
                        $('#jqxgrid').jqxGrid('clearfilters');
                        $('#jqxgrid').jqxGrid('hideloadelement');
    
                    }, 2000 );
    
                }

    nja
    Participant

    Hi,
    I removed the beginupdate and endupdate and that seems to have fixed it. Sorry, must have copied them in from a different code sample.

    thanks,
    nja

    in reply to: loadComplete does not fire. loadComplete does not fire. #69775

    nja
    Participant

    Thanks. URL is valid. No error notices in console. Will just have to chalk this up to solar flares.

    thanks,
    nja

    in reply to: "stacking" filters for a grid "stacking" filters for a grid #69098

    nja
    Participant

    Hi,
    Thank you that has got it.

    Interesting behavior note, changing the filter works very fast. Removing the filter seems to take a very long time.

    It’s not really a problem technically, more a UI problem. If I could set up some sort of notification that would “fix” it, otherwise I find that I have clicked on the list box item multiple times and have turned the filter back on.

    Just an fyi, this grid is about 2400 rows.

    thanks again,
    nja

               $("#jqxCategoryWidget").on('checkChange', function (event) {
                    $("#jqxgrid").jqxGrid('beginupdate');
                        var itemLabel = event.args.value;
                        var filtergroup = new $.jqx.filter();
                        var filter_or_operator = 1;
                        var filtertype = 'stringfilter';
                        var filtervalue = itemLabel;
                        var filtercondition = 'contains';
           
                        
                        var checkedItems = $("#jqxCategoryWidget").jqxListBox('getCheckedItems');
                        if (checkedItems.length == 0) {
                            // need some sort of ui notification that this may take a moment....
                            $('#jqxgrid').jqxGrid('removefilter', 'HexColor', true);
                           
                        }
                        else {
                            for (var i = 0; i < checkedItems.length; i++) {
                                var filter_or_operator = 1;
                                var filtervalue = checkedItems[i].label;
                                var filtercondition = 'equal';
                                var filter = filtergroup.createfilter(filtertype, filtervalue, filtercondition);
                                filtergroup.addfilter(filter_or_operator, filter);
                            }
                        }
    
                        // add the filters.
                        $("#jqxgrid").jqxGrid('addfilter', 'HexColor', filtergroup);
                        // apply the filters.
                        $("#jqxgrid").jqxGrid('applyfilters');
    
                       $("#jqxgrid").jqxGrid('endupdate');
                });
    
                   

    nja
    Participant

    Thanks. I’ll see what I can get working.


    nja
    Participant

    That fixed it.

    thanks,
    nja


    nja
    Participant

    JavaScript and jQuery are case sensitive. Who would have guessed? Been in the windows world too long.

Viewing 10 posts - 16 through 25 (of 25 total)