I'm trying to register onClickListener and onCreateContextMenuListener on a GraphicalView object. However it seems that the listeners are not receiving the clicks and long clicks.
How can I create Context Menu on GraphicalView objects?
aChartEngine, GraphicalView OnClickListener not working
I found the answer here. You have to setCLickEnabled on the renderer.
Related
I am able to send custom parameter along with custom event to firebase analytics in android using below method :-
Bundle bundle = new Bundle();
bundle.putString("Action", "Action Perform Android");
bundle.putString("Category", "CustomEvent Android");
bundle.putString("Label", "click me");
firebaseAnalytics.logEvent("Button_clicked", bundle);
Above method is working and we can see this event on firebase console.
Here are some event that event name is reserve and we can not use this name again to send event to Firebase analytics like notification_dismiss, notification_open etc. These predefined events are automatically collected by Firebase.
Now I want to send some custom parameter along with these above event.
For example when notification_open event fired, I want to add notification title as a custom parameter along with this event. How can we override notification_open event or how can we set notification title custom parameter along with this event in android?
There is no way to add custom parameters to events that are automatically sent. You will have to define your own event to add those parameters to.
Once you've done that, you can combine the standard and custom event in BigQuery, to get both the default and the custom parameters in a single report.
I try to figure out how to implement a load/error/start/end event for the requesting vector tiles to know if the layer is still requesting tiles or not (similiar to [tile events example][1]http://openlayers.org/en/v3.5.0/examples/tile-load-events.html?q=tile+events) . Right now, the only possibility to get layerstate information on a TileVector is to catch the change event, which i think respond to the render event. Please let me know if you think its possible and i can implement some kind of custom event with not too much efforts or if its nearly impossible.
I'm programmatically pushing an object (using pushObject) into a list that is sortable. My problem becomes that if I try $(selector).sortable('refresh') or $(selector).sortable('serialize') the serialize doesn't contain the recently added dom item. I can console.log($(selector)) and it seems to know that the dom item has been added though.
My original thought is there an event to watch for once pushObject has finished? Or a callback?
Is there an event to watch for on pushObject?
Easiest way to do this is add an observer that fires when the list length has changed. But probably that's not gonna be enough in this case.
It sounds like this is a timing issue. If you try to call refresh right after pushObject (or even in an observer) the refresh code is going to run before the dom has been updated.
The trick is to make sure you are calling $(selector).sortable('refresh') after the new elements have been written to the dom. That could be from a didInsertElement hook on the dom item's view or from an observer, but as #Luke reminded me in comments best way to do it is by scheduling refresh to run after render has completed. Something like:
Em.run.schedule('afterRender', this, this.refreshSortable)
I'm having a great time playing around with knockout js and have just started to get to grips with adding custom bindingHandlers.
I'm struggling a bit with the update function of a 3rd party jqWidget gauge - I can only get it to animate the first time I update the variable. On each update after that it just sets the value directly.
I don't fully understand ko.utils.registerEventHandler() and what it does although I've seen it in a bunch of other examples. Is this what is causing the animation to break? How do I know which events to register from the 3rd party widget?
For some reason this works fine if I add a jquery ui slider that is also bound to the observable.
You can test this here: set the value a few times to see that it animates the first time and not after that.
http://jsfiddle.net/LkqTU/4531/
When you update the input field, your observable will end up being a string. It looks like the gauge does not like to be updated with a string value, at least after the first time.
So, if you ensure that you are updating it with a number (parseInt, parseFloat, or just + depending on the situation), then it appears to update fine.
Something like:
update: function(element, valueAccessor) {
var gaugeval = parseInt(ko.utils.unwrapObservable(valueAccessor()), 10);
$(element).jqxGauge('value', gaugeval || 0);
}
http://jsfiddle.net/rniemeyer/LkqTU/4532/
You would generally only register event handlers in a scenario like this to react to changes made by a user where you would want to update your view model data. For example, if there was a way for a user to click on the gauge to change the value, then you would want to handle that event and update your view model value accordingly.
I'm answering the
I don't fully understand ko.utils.registerEventHandler() and what it does
part of your question.
registerEventHandler will register your event handler function in a cross-browser compatible way. If you are using jQuery, Knockout will use jQuery's bind function to register the event handler. Otherwise, will use the browser Web API with a consistent behavior across browsers.
You can check it out on the source code.
On one of my pages, I want to ask users first whether they want to navigate away. When user answers no, no transition should occur.
I tried this code:
$('#pTakeCardSet').live('pagebeforehide',function(event, ui){
event.stopPropagation();
});
But it doesn't work. The new page is still loaded.
Does anyone have the same problem?
You may be getting bit by a live event - from : http://api.jquery.com/event.stopPropagation/
Since the .live() method handles
events once they have propagated to
the top of the document, it is not
possible to stop propagation of live
events. Similarly, events handled by
.delegate() will always propagate to
the element to which they are
delegated; event handlers on any
elements below it will already have
been executed by the time the
delegated event handler is called.