bootstrap-table refresh custom handler - bootstrap-table

I am using bootstrap-table, and want add my custom handler for refresh buttons and not to run the default handler.
How I can do this?
Something like:
$('.refresh').click(function() {
// refresh was clicked
});

Click on the red ribbon on the right side to see the source Refresh Documentation
$('.refresh').click(function() {
$('#table').bootstrapTable('refresh');
});

Related

Refreshing values on fields

I have multiple pages in my applications, one of them is to add a driver information.
When i go to add driver information page and fill some of the fields like "driver licence" text box, then i do not add this to DB and click "go back" button (that discard the changes and come back to home page) when i enter again to this page the fields that i have previously filled in with data do not clear and refresh (its supposed to all fields be clear and empty)
Does anyone have a solution for that?
code for "go back button:
app.datasources.driver.clearChanges(function() {
console.log("cleared changes");
});
returnToDriver();
returnToDriver() code is:
app.datasources.DRIVERS_LIST.query.clearFilters();
app.datasources.DRIVERS_LIST.load();
app.showPage(app.pages.Driver);
Already tried:
widget.root.descendants.TextBox1.value = "";
widget.root.descendants.TextBox1.value = null;
but do not work for me.
Regards
Potentially there are can be multiple ways to leave the page:
browser navigation including navigation hotkeys
links on the page that can navigate to other pages
in-app navigation buttons/hotkeys
etc...
The best way to handle all possible navigation scenarios is using onDetach page event
// Implicit way
// page onDetach event handler, assuming that page
// is bound to appropriate datasource:
// #datasources.<MyDatasource>.modes.create
widget.datasource.clearChanges();
// Explicit way
// Explicitly clearing changes for create datasources in
// page onDetach event handler
app.datasources.<MyDatasource1>.modes.create.clearChanges();
app.datasources.<MyDatasource2>.modes.create.clearChanges();
...
Once you add this code to the onDetach page's event handler you can remove all other clearChanges occurrences from the page.

How to use Meteor FlowRouter.withReplaceState

This is a different problem from a similar question about 'reload'. This use case has to use 'withReplaceState' to handle back button reloading.
I've found the FlowRouter documentation for FlowRouter.withReplaceState(fn), but I've been unable to find specific code examples and can't get it working.
My problem is with Isotope, a plugin that moves elements around when window is resized. User sometimes visits Isotope page, goes to another page, re-sizes window, then presses "back" button to return to Isotope page. Page has to reload to re-trigger the Isotope layout correctly for the new window size.
This is my route. How would I use FlowRouter.withReplaceState() to ensure that user who clicks back button is not seeing the cached page?
FlowRouter.route( '/work', {
action: function() {
BlazeLayout.render( 'body-static', {
content: 'work',
});
},
});

Meteor: How to override verify email popup dialog which appears after clicking email verification link

I want to add some fields to popup dialog which appears when user click on verification email link sent to there email. Actually i want to extend the sign up process. So when user clicked on verify link i want to show some more fields like zip code and date of birth in popup and on clicking save those fields should save to user modal.
Any help will be highly appreciated. I am new to meteor.
I am using ian:accounts-ui-bootstrap-3 for sign up process.
Some more details if needed !
With the following package, you can replace templates :
https://github.com/aldeed/meteor-template-extension
So you create your own template, then replace the default one :
Template.emailVerifiedDialog.replaces("_justVerifiedEmailDialog")
Your dialog will be shown on every pages, you have to add the behaviour to make it visible when necessary
Template.emailVerifiedDialog.helpers({
visible: function () {
return loginButtonsSession.get('justVerifiedEmail');
}
And manage click button event :
Template.emailVerifiedDialog.events({
'click #just-verified-dismiss-button': function () {
loginButtonsSession.set('justVerifiedEmail', false);
}
});
Ok, i found solution myself.
Here it is if some one else also looking for this.
We can override email popup dialog by overriding login_buttons_dialogs.html file in /meteor-accounts-ui-bootstrap-3 folder.

Backbone menu refresh handling

I am using yeoman workflow http://yeoman.io/ ,
I have build a simple menu layout to handle the menu css :
var menu = new Backbone.Layout({
template: "layouts/menu",
className: "menu",
events: {
'click a': 'changeActive'
},
changeActive: function(e) {
$(e.target).parent().siblings('.active').removeClass('active');
$(e.target).parent().addClass('active');
...
It work fine but I am facing a problem in which I bump into very often,
when user clicks on browser's refresh button of course it doesn't remember the state and display
the initial state.
What is the best way to solve that ?
You could save the last selected value to the cookie or to the localStorage and inside the initialize method make it active.
You can update the hash and save selected value there. On initialize just get it and make proper menu active.

How to impliment a jquery dialog window that acts as the windows message box?

I am implementing a jquery dialog which acts as the windows message dialog in asp.net.I want to build a dialog in jquery which should wait until the user send the confirmation and the asp.net code execution should stop unless until I click on the confirmation box with ok and cancel button.How I can implement this dialog. I am using the ScriptManager.RegisterStartupScript in the code window in asp.net.I removed the default message confirmation window of asp.net.I want to build the same message window with jquery...
Is it possible?
Why can't you use "confirm" function that is part of javascript ?
Look on this example:
...script type="text/javascript"...
function confirmation() {
var answer = confirm("Leave http://stackoverflow.com?")
if (answer){
alert("Bye bye!")
window.location = "http://stackoverflow.com";
}
else{
alert("Thanks for sticking around!")
}
}
.../script...
may be this example helps you.

Resources