apply phone number mask

3 posts, 0 answers
  1. Vince
    Vince avatar
    13 posts
    Member since:
    Dec 2016

    Posted 06 Jan 2017 Link to this post

    Hi! 

    I have one column in my kendo grid.

     columns.Bound(c => c.PhoneNumber).Filterable(ftb => ftb.Cell(cell => cell.Operator("contains")));

    I use the build-in filter for this column. However, my data of "PhoneNumber" is a STRING in "(123)-456-7890" format. So when I put 1234567890 in the filter textbox, there is no result. I saw an example to apply a phone number mask for kendo text box. Is it possible to apply one for a grid column filter?

  2. Vince
    Vince avatar
    13 posts
    Member since:
    Dec 2016

    Posted 09 Jan 2017 Link to this post

    Update, I'm trying to find the ID of the built-in filter textbox. Then I can use jquery to add a keyup event to achieve the mask. Is there any way to add a id to the textbox?
  3. Daniel
    Admin
    Daniel avatar
    4949 posts

    Posted 10 Jan 2017 Link to this post

    Hello Vince,

    Here is one of the possible ways to get access the textbox:
    $("#grid input[data-text-field='ShipName']")

    You can test the snippet in the following demo:
    Filter row demo

    Regards,
    Daniel
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top