conditional non-delegated jQuery UI tooltip - jquery-tooltip

Is it possible to create and display an ad hoc jQuery UI tooltip, from with a particular TD element's mouseenter eventhandler, conditionally, if the value of the cell is above a certain amount, say? The code would test the cell's value and instantiate and display the tooltip after 500ms had elapsed, and close the tooltip in the mouseleave. By "ad hoc" I mean without having attached the tooltip to a selector in the document.ready section.
EDIT: The reason for my question: is there a significant memory or processing overhead to attaching a tooltip to every cell in a large table, when only a few of the cells would actually meet the conditions where a tooltip would be opened?

Related

Add event listener when a `<div>` tag changes size on screen

There's a collapsible sidebar on my webpage. When I collapse it, I want the svg element on the page to resize to take up all of the new blank space.
The function that resizes the svg is working. However, it is not being triggered when the sidebar is collapsed.
I have tried:
d3.select("#mydivHoldingSVG").on("resize", MyResize)
Where #mydivHoldingSVG is a <div> and MyResize is the function to resize the svg.
When the sidebar is collapsed, the <div> element increases in size (as inspected via Google Chrome developer view), which I thought constituted a "resize".
If the window is resized, that is, if I use:
d3.select(window).on("resize", MyResize)
Then the svg resizes correctly.
I have looked at the list of standard events to see if one can be applied to the div element (#mydivHoldingSVG) but I'm not seeing an obvious "when a div element changes" event.
Is there an eventListener that can be added on a <div> element being resized or changed?
The gist is that you should do it another way: the resize event only pertains to the window and will not fire on any other element.
The cleanest way to solve this problem would be call MyResize when you call whatever function is collapsing your sidebar, rather than trying to indirectly listen for the sidebar being collapsed.

How to prevent d3 brush events from firing after calling brush.move

I am displaying several identical charts (showing different datasets) side-by-side. Upon brushing on one chart, the brush should be replicated on all others.
Currently, I do this by calling brush.move on a selection of all charts excluding the currently brushed chart, as soon as someone brushes on a chart. This happens in a brush-type eventListener.
However, this brush.move triggers the brush-type event attached to the brush, leading to an error (or, more generally, an infinite loop).
How can I prevent this?
You can use the d3.event object to check what caused the update of the brush. From the API docs on brush events:
Brush Events
When a brush event listener is invoked, d3.event is set to the current brush event. The event object exposes several fields:
…
sourceEvent - the underlying input event, such as mousemove or touchmove.
If your brush is modified programtically, i.e. by calling brush.move(), the d3.event.sourceEvent property will be null, because no input event caused this update. In your event handler you can check this property to skip execution for programmatic changes:
if (!d3.event.sourceEvent) return;
The same technique is employed by Mike Bostock in his Brush Snapping Block. While handling the actual input event the brush is modified again to snap to the nearest value, which, obviously, should not trigger another run of the event handler.

The Kendo ui Scheduler does not render correctly

The Kendo ui Scheduler does not render correctly unless the containing element is visible at initialization time.
If you call .kendoScheduler() on an element that is not "on screen" (e.g. display: none) it does not render and function correctly.
In particular the height, scrollbars and time bar properties do not result in expected functionality. But if element start visible the problem does not appear
Error example
The Scheduler uses JavaScript size calculations and these do not work for hidden elements.
To readjust the widget layout, execute the resize() method of the Scheduler after it becomes visible.
http://docs.telerik.com/kendo-ui/styles-and-layout/using-kendo-in-responsive-web-pages#individual-widget-resizing

PowerPoint2007 Shape Object On Focus Event and OnFocus out event

I have been searching, on capturing the event or some property that tells that a shape (text Shape Object) is onfocus. as this will help in capturing the keyboard event, so that if the text changes the rectangle width can be increased.
as shown in the link http://s2.postimg.org/scxtx0ec9/Untitled.png
There aren't any such events. There's a SelectionChange event that's fired when the current selection changes; you can trap that then test to see what's currently selected (ie, Slides, Shapes, Text, etc) and react accordingly.
But is there some reason why you can't simply set the text container to automatically resize to fit text? That is, set the shape's .TextFrame.AutoSize property to ppAutoSizeShapeToFitText (Long = 1)

Mouse hover event in MVC

I am working in MVC and I want to show my data in an asp GridView and I also want to change the row backcolor whenever mouse hover that particular row. Please let me know how can I do that.
Thanks in advance,
gbhatnagar.
Use Javascript (JQUERY!) and have an on hover event for the row. So when hovered over, you switch the previously highlighted row go back to normal and change the colour of the current row.
You could easily do it with Jquery and by having a row css class and a highlighted row css class.

Resources