Git Product home page Git Product logo

ej2-ng-dropdownlist-tooltip's Introduction

DropDownList items with Tooltip for Angular

Tooltip is displayed for the selected item in DropDown element

By using title attribute with change event handler, you can enable the tooltip support to selected item which is shown in input element. Whenever selection changed, need to update the title attribute value from selected item’s text content. Please refer the below code snippet,

 public onChange: any = (args: SelectEventArgs) => {
     let dropDownObj: HTMLElement = document.getElementById('ddlelement');
     dropDownObj.setAttribute('title', args.item.textContent);
  }

Tooptip for all the list items in dropdown popup

We can enable the tooltip option to all the list items by using title attribute with open event.Please refer the below code snippet for enable the tooltip for all the list items in open event handler.

public  onOpen: any  = (args:PopupEventArgs) => {
    // get all the list items
    let listItems: any = args.popup.element.querySelectorAll('li');
    let length: number = listItems.length;
    for (let i: number = 0; i < length; i++) {
        // set title attribute to all the list items.
        listItems[i].setAttribute('title', listItems[i].textContent);
    }
}

Installing and Running Application

Installing

To install all dependent packages, use the below command

npm install

Run the application

To compile and run the source files, use the below command

npm start

ej2-ng-dropdownlist-tooltip's People

Contributors

prasanthpalani avatar rajendranr-5483 avatar saravanangn avatar sarubala20 avatar syncfusionbuild avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

prasanthpalani

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.