Angular: Need to call a function on close(X) of <apk-modal> - modal-dialog

I want to call a function when closing a modal by clicking cross(X) button
I am displaying modal using <apk-modal>
I am expecting a function call on click of it, I dint see any such solution

Related

Enabling and Disabling GUI button Matlab

This is a very strange problem, because I am quite sure the logic is proper but it is still not working. So when the GUI starts, in the starting function, I set most of the buttons to be inactivated using the following line of code for every button, Kbutton, Bbutton etc..:
set(handles.Kbutton,'Enable','off');
set(handles.Bbutton,'Enable','off');
Then, when the user clicks on any cell in the uitable, I use the cell selection callback to get the info about the contents of the cell, and re-activate the buttons that can be used from then on:
set(handles.Kbutton,'Enable','on');
set(handles.Bbutton,'Enable','on');
And till now everything is ok.
So then the user clicks on a button, say Kbutton, and the underlying function is executed thanks to the button's callback function. Once the method is ready I would like to return the buttons to their initial state i.e. inactivated. So logic tells me, re-put the initial line of code at the end of the callback function and done:
set(hObject,'Enable','off');
drawnow;
set(handles.BButton,'Enable','off');
drawnow;
Where the first line of code in the above snippet, refers to the button who fired the callback and BButton is any other button in the GUI.
For some strange reason only the second one is being enabled off. I.e. the button that fired the callback is staying enabled on :/
Has anyone encountered the same problem?
Any ideas?
Thanks in advance
Try changing
set(hObject,'Enable','off');
to
set(handles.Kbutton,'Enable','off');
You click on tools =>gui options =>Generate FlG file and MATLAB file

Angular-Strap Modal questions - Controller and Callback Functions

At the moment I am using the bootstrap-ui modal and it give me the possibility to create an own controller for each modal where I can assing some values from the current form and when I close the modal with the "OK" button an callback function is called, where I can get also some values I've selected in the Modal before when I assing them to the callback function.
And its also possible to open the modal with $q and return the modal as promise.
Are these options also possible with the angular-strap modals? I can't find something about this in the documentation.
I found the AngularStrap documentation (if they want to call it that) quite lacking. You've really either gotta check the source, or find an example elsewhere for many common issues.
Yes, the $modal object can accept promises, but I haven't touched that in a while. I'm a little knowledgeable about Bootstrap-UI's modal implementation and found that it was more robust, so I can't say for certain that you'll find what you need in AS'.

"Send" button popup not appearing correctly

I'm using the Facebook Like/Send buttons along with dynamically generated HTML (loaded via AJAX requests). I've found that even though the Send button works fine when the element exists on page load, dynamically created Send buttons aren't working correctly. Clicking the button activates it and the button greys out, but the popup doesn't appear.
Here is a demonstration of what is happening: http://jsfiddle.net/Daniel15/VxpSj/
Any suggestions?
Thanks!
Yes, I can confirm the problem from your fiddle.
function addLikeButton()
{
// […]
FB.XFBML.parse(newEl);
document.getElementById('container').appendChild(newEl);
}
For some reason, this seems to be “the wrong way around”. Reverse the order of these two lines – put the new element into the DOM first and let FB.XFBML.parse parse it afterwards, then (from my test with your fiddle) it seems to work in the desired way.

JavaScript: How to force a page reload on reset?

I have a page with some generated HTML that survives the form's reset button. It is a problem because that HTML is inconsistent with the values in the cached default form.
In principle I guess it could be solved easily if I could force a hard reload from the server when the user presses the reset. However I see that the Chrome browser does not support the onReset event (in fact it is deprecated in HTML5).
But perhaps I could work around the missing onReload event. Can I re-define what happens when the reset button is pressed? In my case the apply and reset buttons are located in general HTML templates which I cannot change. Can I attach a function to the button from JavaScript?
You can replace the "reset" button , by a regular button.
And use the "onClick" event, to trigger a page reload.
EDIT
oops I missed the template part,
You can add a function to a button from Javascript.
First you need to "get" the button, with something like document.getElementbyId('resetButton');
If the button doesn't have a ID, you still can to retrieve it by doing javascript dom traversal
then you can add a function like :
var resetButton = document.getElementbyId('resetButton');
resetButton.onclick= reloadPage;
function reloadPage(){
window.location.reload();
}

How can i call Java Script Function form my objective C class

I am displaying a URL in uiwebview, and I'm getting a list in popover controller, now my requirement is when user will select any item from that popover list then I need to call a JavaScript function with parameters which I selected and according to my selection JavaScript function will change URL content.
The code which is I am trying to call JS function is given below but it is not working for me:
[self.myWebview stringByEvaluatingJavaScriptFromString:#"loadpano(\"panoXML.php?params=panoId=9572|lang=de|parkourId=342\",null,MERGE,BLEND(1));"];
Please provide me any solution for that.