Additonal Parameters with Filterable.UI

2 posts, 0 answers
  1. StuartF
    StuartF avatar
    3 posts
    Member since:
    Nov 2005

    Posted 24 Oct 2014 Link to this post

    I'm currently looking at Filters on the ASP MVC grid. 

    I have this line on my grid:

    .Filterable(filterable => filterable.UI("$.fn.kendogrid().userDropdownFilter"))

    which works fine, and I can access the original filter element in the userDropdownFilter(element) function in my JavaScript.

    I was wondering if it was possible to send additional parameters to this function though, and still pass the original element variable?

    Thanks
  2. Alexander Popov
    Admin
    Alexander Popov avatar
    1444 posts

    Posted 28 Oct 2014 Link to this post

    Hi StuartF,

    This could be done by using a simple proxy function. For example: 
    columns.Bound(p => p.ProductName).Filterable(x => x.UI(@<text>function(e){ myCustomFilter(e, "customParameter") }</text>));
    ...
    <script type="text/javascript"
        function myCustomFilter(e, param) {
            alert(param)
        }
    </script>


    Regards,
    Alexander Popov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top