How to pass the arguments to a click function of a button through javascript - javascript-events

on document ready I have registered for a click event for a button. now from the knockout JS click event I want to pass few extra parameters the javascript click event. how do I acheive this.

Related

start pace.js right after click button for call ajax and $http

I have used pace.js as my progress bar but it is shown only when page loads or reloads and the times when it wants to load data received from ajax or $http calls, not before that. what should I do to start pace right after click button?
Just found out from the API doc that you can use the Pace.restart() function on button click
e.g
`

kendo UI Scheduler Add but keep window open

I am using a template for adding/editing an event. What I would like to do is be able to add an event but keep the window open and retain the entered data so the user can change a couple of fields and save that other event. There are 2 save buttons, "SAVE", and "SAVE and ADD NEW". The first button will save the entered event and close the dialog window. The second button will save the entered event but will keep the window open, user changes one or more fields, then save that new event (repeat as necessary).
Any advice or pointing me in the right direction is appreciated.
You can try using the "save" event of the Scheduler to make copy of current event and then call the "addEvent" method of the Scheduler with it. Check the Scheduler API below:
Scheduler: API

Wicket: Modal Windows and callback functionality

I have a modal window that shows a panel which contains a form that has some textfields and a submit button
on submit an insert into the database occurs and then I have some ajax behaviour that i want to activate on the modal windows containing page on click of the button.
So flow is at present:
click link
modal window appears
user fills out form
user submits form
form data persisted to db
modal window closes
I need it to do this in addition:
activate some ajax behaviour on the page that contains the panel
any help on how best to do this in the wicket way is appreciated.
I resolved this by passing an instance of the page containing the panel to the panel (i.e. - in the constructor), then calling a method on the page from the panel to perform the Ajax update.
I would be interested to see what others have done or to hear if there are issues with the approach I have taken.
Set up a WindowClose callback.
In the WicketStuff project called ModelX (Disclaimer: I'm the developer of that) I have created an IWindowClosedListener interface which has a method:
void windowClosed(Panel panel, AjaxRequestTarget target)
So then any Page or Panel that can open a modal that needs to do something when that modal is closed simply implements that interface and its windowClosed method gets called at the right time.

Attach event handler to KendoUI widget (View)

I am attempting to work an existing web app to use Kendo (Mobile) UI widgets.
All of the existing javascript code base is contained within AMD modules (RequireJS).
I would like to attach a 'show' event handler to a view, so that the app can request data from the back end, however the data logic is within a module, and cannot be called from the page script (and thus, I can't use Kendo data-event attributes).
I thought that I would be able to to attach an event handler in code like so:
$('#tabstrip-browse').on("show", function(e) {...});
however, the event handler is not called.
Is there a way to do this?
Seems I'm finally able to answer my own question
My issue was that I was trying to use jQuery event binding syntax to bind to the events, however, KendoUI does not expose events in a jQuery friendly/compliant way.
However, there is a way to do this using the KendoUI API
There is no standard 'show' event in javascript or jQuery. You can bind custom events, but you need to also include a way to trigger them.
Here's a trivial example:
// bind the custom event
$('#element').on('show', function(e) {
// handle the custom event
});
// trigger the custom event
$('#element').trigger('show');
There is an attach event on Durandal
https://groups.google.com/forum/#!topic/durandaljs/UQ9hXpwP_ds

What event fires to an firefox extension when the back button is selected or history item is selected

My extension needs to know that the tab is displaying something from the history rather than the latest loaded document.
onload doesn't seem to be the right event. It doesn't always fire.
Use the pageshow event, it fires after the onload event and has a parameter called persisted that will be set to true when the page is loaded from the cache.

Resources