Is there an event triggered when there's a page change in an ioslides presentation? I'd like to allocate some resources to display the slide, and release them when the user moves on.
Yes, ioslides triggers slideenter and slideleave events on each slide. These are currently handled as strings, so you'd use Javascript like
slide.setAttribute("slideenter", "somecode();");
to execute somecode(); when the slide is entered. See also this answer: Google IO Slides Template - Javascript on each slide
Related
I'm using ag-grid and I'd like to save the layout/state of the user. Pretty much something like this
This solution forces the user to click on the button to save the preferences ("Save state"). There is some other way/event to detect that the user changed the state of the table (in order, to me to save and avoid to force the user to click on a button for that)?
I was hopping to find some method here but i didn't..
I initially had code that listened to all of the applicable events from the grid, but ultimately, I found it easier to just save the entire grid state in the component's onDestroy method, regardless of whether anything has actually changed.
Found my answer here.
All the events are here but i prefer to add a global event:
addGlobalListener(listener) Add an event listener for all event types coming from the grid.)
Source: AgGrid javascript grid api
I am using cwebpage integrated into my program. CWebpage information can be found here:
https://www.codeproject.com/Articles/3365/Embed-an-HTML-control-in-your-own-window-using-pla
My question is regarding events. I currently have this setup to setup click events using get_anchors() in IHTMLDocument2. I then iterate over all of the elements to create a IDispatch in memory. This holds the event information. When an item is clicked, it sends a WM_NOTIFY to the window and then I can handle the event and parse out what I need to parse from the element that was selected.
This all works fine until I run into a page in my software with close to 50,000 anchor tags in which we run out of memory since we hold the events in memory until the the page is destroyed.
Is there a simple way to obtain the clicked element without having to set an event for each individual element? Is it possible to set a click event at a document level and then find the element that tripped it? All I am trying to do is obtain the id of the element that is clicked.
What I've tried:
I tried to just use a WM_LBUTTONDOWN message read in our browser window and then use htmlDoc2->elementFromPoint() to simply get the information that I need from the element selected. This however does not work well if the page is zoomed or wraps.
Please note this programming is in C/C++, not javascript or vb.
Thank you.
HTML events "bubble" from child elements to parent elements. So, you can simply assign a single onClick handler to the IHTMLDocument2 itself, and then use the srcElement property of the IHTMLEventObj object that is given to your handler every time on onClick event is fired by any child element on the page. See Understanding the Event Model.
I have a classic report with cards. I want to display a value when the user mouseover any of the cards. How can I do that?
One method might be to add a value to card modifiers column, then run a Dynamic Action after refresh of your region, that would execute the following JS (fire on initialisation).
The first jQuery selector is driven by your card modifier value - I used 'titleA'
$('.titleA a').attr('title','Help me');
This should modifer your generated HTML accordingly
There are three mouse related dynamic actions you can use without having to write any JavaScript:
Mouse Enter (mouseenter) - Fires once when the pointing device is moved into the triggering element.
Mouse Leave (mouseleave) - Fires once when the pointing device is moved away from the triggering element.
Mouse Move (mousemove) - Fires when the pointing device is moved while it is over the triggering element.
Docs here.
The TextBox class already supports undo, as it is present and functional in the context menu.
I would like to implement undo/redo buttons as found in every common document editor such as Microsoft Word. They would be disabled when they have no action to take, and when there is an undo/redo stack to move through, pressing the buttons would cause the TextBox's contents to undo and redo.
Looking at the TextBox API, there doesn't seem to be any mention of how to hook into the undo data. The only discussion is a mention that undo is present on the context menu.
How are undo/redo hooks implemented on a TextBox?
If it makes a difference, I'm currently coding in C++/CX.
You definitely can record the history manually by TextChanged event. Undo command is used to display the previously input. Hook into the control seems not possible.
Handle the ContextMenuOpening event from TextBox and you can modify the Popup by your own commands, for example your own undo/redo history.
A good sample: https://code.msdn.microsoft.com/windowsapps/Context-menu-sample-40840351 also works fine with UWP.
I've implemented ChrisBanes' pull-to-refresh using a Stock Action Bar.
However, after the pull, the "Loading..." message appears and covers all my action bar buttons. This is great, and what I expect. However, if I touch the action bar where I know the buttons normally are, they behave just as if the buttons were there.
How can I get the 'loading...' actionbar header to consume all touch events?
How can I get the 'loading...' actionbar header to consume all touch
events?
The reason it doesn't to begin with is due to how the View is added to the Window. When PullToRefreshAttacher creates the WindowManager.LayoutParams used for calling WindowManager.addView(View, LayoutParams), it uses the flag:
WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE
Which as per the docs indicates:
Window flag: this window can never receive touch events.
So, if you want the header view to consume touch events, you'll have to modify the PullToRefreshAttacher and remove this flag.