Ignition-Perspective Table- Mouse Over Value

Hi,

can some one help me , to get the table value in tool tip at mouse over and attached image for better understanding


you’ll probably have to change the column to be a view with a label and put your tooltip on the label

@victordcq Thanks for the reply, can u pls elaborate…

presently, am able to get the value on tool tip based on the selection(Table Events-on click-Pushing Table Data Selection).

Is your question how to get the value of the cell you are hovering over, or how to get the tool tip to show at the location where you are hovering?

Create a view with a label in it. (ex labelWithTooltip) (best probably a flexcontainer)
Give it a view param named value

Bind the labels text to the param.value
Bind the labels tooltip text to the param.value, and enable tooltip

In your table, add columns to the column param, be sure to match field with the data’s name
set columns.viewPath to your label view path (labelWithTooltip)
set columns.render to view

done

yes, am looking get the value of the cell, when we hover mouse

Why? Is it not already visible in the cell or are you displaying something else?

Hey thanks,

Its working for me for string values, am not able to get the number values in the tool tip, is there any other changes need to be done for numbers (Table Population columns)…

Hey, posted image with test data.

Actually condition, we are opening the report based on the SN selection on table,
sometimes SN will not fit in the column So, will provide same on tooltip.

it convert to string then with an expression toString - Ignition User Manual 8.1 - Ignition Documentation

I looked at this a little bit, but I didn’t come up with as clean a solution as @victordcq for this application, but nevertheless, I figured I would go ahead and post what I had developed in case the direction could be of use to somebody.

def runAction(self, event):
#==============================================
#	self.props.columns[0].strictWidth = True
#	self.props.columns[1].strictWidth = True
#	self.props.columns[2].strictWidth = False
#==============================================
	self.props.rows.height = 30
	mousePositionX = event.pageX-self.position.x
	mousePositionY = event.pageY-self.position.y
	row = (mousePositionY/self.props.rows.height)-2
	if mousePositionX < self.props.columns[0].width:
		self.meta.tooltip.text = str(self.props.data[row].city)
	elif mousePositionX < (self.props.columns[0].width + self.props.columns[1].width):
		self.meta.tooltip.text = str(self.props.data[row].country)
	else:
		self.meta.tooltip.text = str(self.props.data[row].population)

The preceeding code running on the onMouseMove event script produces the following result:
It uses the mouse position relative to the component’s placement, cell height, and column width to determine what cell the mouse is hovering over

Screenshot_20220905-231122-705

@justinedwards.jle
i doubt that will work with scrolling:/

1 Like

Agreed

Thanks for ur support, i will check the same.

Meanwhile, kindly share some resources to explore cust properties like event.pageY-self.position.y…

Just throw a label somewhere on the page and use something like this in the event you’re wanting to use. It will reveal a lot of what is available:

self.getSibling("Label").props.text = str(event)

The preceding code on the table’s onMouseMove event results in this being printed in the label:
image
From there, if you see something that looks useful, just look it up directly in the online ignition resources. The information available is extensive.

1 Like