Error using two event handlers in c1-flex-grid-filter MVC TagHelper

Posted by: lxrp-bst on 11 January 2021, 5:54 pm EST

    • Post Options:
    • Link

    Posted 11 January 2021, 5:54 pm EST

    Hi,

    When I am binding functions to a single event in the c1-flex-grid-filter tag helper (e.g. filter-applied) I can simply add the name of the function:

    <c1-flex-grid-filter default-filter-type="Both" filter-changing="filterChangingFunction"></c1-flex-grid-filter>
    

    However when I attempt to add 2:

    <c1-flex-grid-filter default-filter-type="Both" filter-changing="filterChangingFunction" filter-applied="filterAppliedFunction"></c1-flex-grid-filter>
    

    I get the following error:

    FastFilterAIP:289 Uncaught ReferenceError: filterChangingFunction is not defined

    Interestingly the first one defined (in this case filterChangingFunction) actually works and is called when the even occurs, but the second one does not.

    The solution I found is to wrap each one in a calling function, this seems to work, but I think its a bug:

    <c1-flex-grid-filter default-filter-type="Both" filter-changing="function callFilterChanging(s,e){filterChangingFunction(s,e);}" filter-applied="function callFilterAppllied(s,e){filterAppliedFunction(s,e);}"></c1-flex-grid-filter>
    
  • Posted 12 January 2021, 6:01 pm EST

    Hi,

    We are sorry but we are unable to replicate the issue at our end. Please refer to the attached sample for reference.

    <script>
        function filterChanging(s, e) {
            console.log("filter changing");
        }
        function filterApplied(s, e) {
            console.log(s.grid.rows.length);
        }
    </script>
     <c1-flex-grid auto-generate-columns="true" is-read-only="true" height="500px" id="flexgrid1">
            ....
            <c1-flex-grid-filter id="filter" default-filter-type="Both" filter-changing="filterChanging" filter-applied="filterApplied"></c1-flex-grid-filter>
        </c1-flex-grid>
    
    

    Regards,

    Manish Gupta

    FlexGridFilter-Events.zip

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels