Search Panel and toolbar template

5 posts, 0 answers
  1. Morten
    Morten avatar
    345 posts
    Member since:
    Jul 2012

    Posted 20 Sep Link to this post

    Hi Support.

    The Search panel is a great new feature (https://demos.telerik.com/kendo-ui/grid/search-panel).

    Will it work together with the toolbar template?

    Best regards

    Morten

     

     

     

  2. Alex Hajigeorgieva
    Admin
    Alex Hajigeorgieva avatar
    793 posts

    Posted 24 Sep Link to this post

    Hello, Morten,

    The handler for the search functionality is executed on the ".k-grid-search input" selector so as long as you have HTML that will match the selector in the grid toolbar template, the functionality will work as expected. As a minimum, an element with class "k-grid-search" should be a a parent to an input. Here is the built-in HTML:

    <span class="k-textbox k-grid-search k-display-flex">
    	<input autocomplete="off" placeholder="Search..." title="Search..." class="k-input">
      <span class="k-input-icon">
      	<span class="k-icon k-i-search"></span>
      </span>
      </span>

    Below you can find a runnable Dojo with a grid toolbar template and a grid search for your convenience:

    https://dojo.telerik.com/@bubblemaster/AXilOVUR/2

    Let us know in case you have further questions.

    Kind Regards,
    Alex Hajigeorgieva
    Progress Telerik

    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. Morten
    Morten avatar
    345 posts
    Member since:
    Jul 2012

    Posted 26 Oct in reply to Alex Hajigeorgieva Link to this post

    Thanks Alex. Works great.
  4. Morten
    Morten avatar
    345 posts
    Member since:
    Jul 2012

    Posted 29 Oct in reply to Alex Hajigeorgieva Link to this post

    Hi Alex.

    I'm adding a hidden close icon (.k-i-close .k-i-x) next to the k-i-search and toggle visibility of the two icons depending on the content in the input element (length>0 only show close icon, else only show search icon).

    Clicking the close icon I remove the value of the input element. However, how do I trigger the search to clear set filters?

    Thank you in advance.

    Best regards

    Morten

  5. Tsvetomir
    Admin
    Tsvetomir avatar
    392 posts

    Posted 29 Oct Link to this post

    Hi Morten,

    My name is Tsvetomir and I will carry on the communication over this thread.

    I believe that the value of the input is cleared in the click event handler of the span, is that correct? If so, the expression that is built to filter the data source would not be cleared because it is built in the input event handler of the input. Therefore, I can suggest clearing out the value and triggering the input event as follows:

    $(".k-grid-toolbar .k-grid-search input").val("").trigger("input")

    Let me know in case the issue is still present.

     

    Kind regards,
    Tsvetomir
    Progress Telerik

    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top