Verint | Telligent Community
Verint | Telligent Community
  • Site
  • User
  • Site
  • Search
  • User
Verint Community 12.x
  • Verint Community
Verint Community 12.x
API Documentation searchresult UI Component
  • User Documentation
  • Ask the Community
  • API Documentation
  • Manager Training
  • Developer Training
  • Tags
  • More
  • Cancel
  • New
  • API Documentation
  • +In-Process API Documentation
  • +Plugin API Documentation
  • +REST API Documentation
  • -Widget, Theme, and Automation APIs
    • +Automation Events
    • -Client-side APIs
      • +Client Messages
      • +Composer Plugins
      • +JavaScript API Modules
      • +jQuery Events
      • +jQuery Plugins
      • -UI Components
        • bookmark UI Component
        • code UI Component
        • collapseexpand UI Component
        • feature UI Component
        • html UI Component
        • Idea Voting UI Component
        • like UI Component
        • links UI Component
        • loading UI Component
        • masonry UI Component
        • moderate UI Component
        • page UI Component
        • poll UI Component
        • previewhtml UI Component
        • rate UI Component
        • resizedimage UI Component
        • scheduledfile UI Component
        • searchresult UI Component
        • select UI Component
        • squeezetext UI Component
        • tag UI Component
        • theater UI Component
        • tip UI Component
        • tourtip UI Component
        • viewhtml UI Component
        • webpreview UI Component
    • +Dynamic Configuration
    • +LESS Functions
    • +Script API Types
    • +Script APIs

searchresult UI Component


jQuery.telligent.evolution.ui.components.searchresult

UI Component which handles automatic presentation and registration of search result items' dynamic behavior. Decorates <div class="ui-searchresult"></div> items to present Ajax-loaded search result details. Overrides can be provided at the theme level to present search result items differently.

This is primarily used by ISearchableContentType plugins to provide for ajax-fetched details (also provided by the plugins) to be dynamically loaded when the plugins' rendered search results are moused over.

Options

Data made available to instances of the component:

  • detailsurl: Ajax endpoint URL for fetching extra search result details.

Example

Given a search result rendered by ISearchablContentType.GetViewHtml ...

<div class="abbreviated-post ui-searchresult"
    data-detailsurl="">
    <div class="post-metadata">
        <ul class="property-list">
            <li class="property-item date">[CONTENT DATE]</li>
            <li class="property-item author">
                <span class="user-name">
                    <a href="[USER_PROFILE_URL]" class="internal-link view-user-profile"><span></span>
                        [USER NAME]
                    </a>
                </span>
            </li>
            <li>
                <ul class="details"></ul>
            </li>
        </ul>
    </div>
    <h4 class="post-name">
        <a class="internal-link view-post" title="Test Wiki" href="[CONTENT URL]">[CONTENT NAME]</a>
    </h4>
    <div class="post-summary">[CONTENT SUMMARY]</div>
    <div class="post-application">
        <a href="[CONTENT APPLICATION URL]">[CONTENT APPLICATION NAME]</a>
        <a href="[CONTENT CONTAINER URL]">[CONTENT CONTAINER NAME]</a>
    </div>
</div>

... and an Ajax callback's response, potentially provided by the same plugin's IHttpCallback's ProcessRequest() ...

<li class="property-item">238 views</li>
<li class="property-item">2 revisions</li>
<li class="property-item">Latest: 12 May 2010</li>

... then the response will be automatically rendered within <ul class="details"></ul> whenever the search result is moused over.

Default Implementation

For reference purposes or as the basis for an override:

(function($){

    var template = ('' +
'<% foreach(properties, function(property) { %> ' +
'<li class="property-item"><%= property %></li> ' +
'<% }); %> '),
        compiledTemplate = $.telligent.evolution.template.compile(template),
        getDetails = function(url, complete) {
            $.telligent.evolution.get({
                url: url,
                dataType: 'json',
                success: function(response) {
                    if(response) {
                        complete(formatDetails(response));
                    }
                }
            });
        },
        formatDetails = function(details) {
            return compiledTemplate(details);
        };

    $.telligent.evolution.ui.components.searchresult = {
        setup: function() {
        },
        add: function(elm, options) {
            if(options.detailsurl) {
                var details = null,
                    detailsList = elm.find('ul.details'),
                    initialDetailsList = detailsList.html();
                elm.on('mouseenter', function(e){
                    if(details !== null) {
                        detailsList.html(details);
                    } else {
                        getDetails(options.detailsurl, function(response) {
                            details = response;
                            detailsList.html(details);
                        });
                    }
                }).on('mouseleave', function(e){
                    detailsList.html(initialDetailsList);
                });
            }
        }
    };

}(jQuery));

  • Share
  • History
  • More
  • Cancel
Related
Recommended
  • Telligent
  • Professional Services
  • Submit a Support Ticket
  • Become a Partner
  • Request a Demo
  • Contact Us

About
Privacy Policy
Terms of use
Copyright 2024 Verint, Inc.
Powered by Verint Community