Jump to content

How to show a list as a tooltip?


arunpandit

Recommended Posts

I need to show a tooltip which is a Html list on date hover.

I can show the date highlighted and a simple message but the list wont show correctly. It is just a garbled mess. I even tried to add in white-space:pre, wrap, wrap-line etc but nothing seems to work. Is there any way to show a list in a tooltip on hover?

Here is the code

export class DatepickerDateClassExample {

list : string = 'Test - Test 1 r/n' + 'Test - Test 2 r/n' + 'Test - Test 3 r/n'; constructor(private renderer: Renderer2) {}

dates = [ { date: "2020-04-20", text: this.list } ];

dateClass = (d: Date) => { const dateSearch = this.dateToString(d); return this.dates.find(f => f.date == dateSearch) ? "example-custom-date-class" : undefined; };

displayMonth() { let elements = document.querySelectorAll(".endDate");

let x = elements[0].querySelectorAll(".mat-calendar-body-cell");

x.forEach(y => {

const dateSearch = this.dateToString( new Date(y.getAttribute("aria-label")) );

const data = this.dates.find(f => f.date == dateSearch);

if (data) y.setAttribute("aria-label", data.text); });

Link to comment
Share on other sites

On 4/4/2020 at 12:14 PM, arunpandit said:

I need to show a tooltip which is a Html list on date hover.

I can show the date highlighted and a simple message but the list wont show correctly. It is just a garbled mess. I even tried to add in white-space:pre, wrap, wrap-line etc but nothing seems to work. Is there any way to show a list in a tooltip on hover?

Here is the code  new projects in mulund

export class DatepickerDateClassExample {

list : string = 'Test - Test 1 r/n' + 'Test - Test 2 r/n' + 'Test - Test 3 r/n'; constructor(private renderer: Renderer2) {}

dates = [ { date: "2020-04-20", text: this.list } ];  new projects in kalyan

dateClass = (d: Date) => { const dateSearch = this.dateToString(d); return this.dates.find(f => f.date == dateSearch) ? "example-custom-date-class" : undefined; };

displayMonth() { let elements = document.querySelectorAll(".endDate");  real estate consulting company

let x = elements[0].querySelectorAll(".mat-calendar-body-cell");  flats in mahim

x.forEach(y => {

const dateSearch = this.dateToString( new Date(y.getAttribute("aria-label")) );  2 bhk in thakur village

const data = this.dates.find(f => f.date == dateSearch);

if (data) y.setAttribute("aria-label", data.text); });

Any Updates????

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...