iOS plugin for PhoneGap not called when click - plugins

I use an iOS plugin for PhoneGap, my plugin works fine when I call him directly, the problem is when I called my plugin at the click event
callNativePlugin('success');//Working fine
$(".Button").on('touchstart',function(){
callNativePlugin('success');//Not working
});

Are you sure that the ".Button" selector is matching an HTML element in the page?
i.e. does this work?
$(".Button").on('touchstart',function(){
alert("touchstart worked");
callNativePlugin('success');//Not working??
});

yes, in fact the problem was a simple javascript conflict that prevented the execution of the event click.
Thank you

Related

How to simulate click on button Flutter WebView

I am using the package webview_flutter. How can I simulate a button click? I tried using the controller to run some javascript:
controller.evaluateJavascript("$('.mybuttonclass').click()")
Unfortunately It seems we cannot use JQuery here as I received a '$ not found error'. Is there a possible workaround?
Try
document.getElementById("myButtonId").click()
Or getElementsByClassName

ionic header bar disappears after reloading the state in angularjs

I am working on a project where I need to use a messaging system.
I have an inbox: When I used the $state.reload() to show the newly sent message but when the state gets reloaded the header bar gets disappeared and doesn't gets visible until i do the manual refresh. I am using ionic 1.1.1 version
I searched a lot but didn't get any suitable reason that why it is happening. Kindly suggest me on this.
So, after searching a lot for ways to solve this problem, that I am also stuck on, I found out there is not! Unfortunatelly updating to the new version of Ionic did not help, and the workaround provided at Ionic's GitHub desn't work for me. It is:
$scope.$on('$ionicView.enter', function(e) {
$ionicNavBarDelegate.showBar(true);
});
But if you have custom buttons in your header, this code doesn't work as expected. There are some jQuery solutions too, but I think it's not what we really need.
Source: https://github.com/driftyco/ionic/issues/3852
EDIT
So, I've worked on a pure Javascript solution, for my situation, and here it is. Hope it can help.
$scope.$on('$ionicView.enter', function(e) {
$timeout(function() {
showHeader();
}, 1000);
function showHeader() {
// Having the nav-bar in your template, set an ID to it.
var header = document.getElementById('header_id');
if (header.classList) {
if (header.classList.contains('hide')) {
header.classList.remove('hide');
}
}
}
});
For me what was causing that issue came from the solution of this problem:
https://github.com/ionic-team/ionic-v1/issues/119
Once i removed this line:
$ionicConfigProvider.views.maxCache(0);
from my config phase the action bar started to work again.

roundslider UI is malfunction due to ionic.bundles.js file in ionic android app

I searched alot about this topic but couldnt find any answer. I am ionic to build a android app. I used roundslider component from www.roundsliderui.com. Though whole roundslider fully works but the text input right in middle of roundslider does not work in ionic. I figured out that ionic.bundles.js script in ionic app is causing problem. If I remove this script, roundslider works fine.
Any advice why this script causing problem?
Thanks
I had the same issue. You have to disable the tap functionality.
http://ionicframework.com/docs/api/page/tap/
"In some cases, third-party libraries may also be working with touch events which can interfere with the tap system. For example, mapping libraries like Google or Leaflet Maps often implement a touch detection system which conflicts with Ionic’s tap system."
<div data-tap-disabled="true">
//Your Round Slider here...
</div>
I hope it helps.
there is a conflict between files of roundsliderui and ionic
read this article thats will help you
The problem is that the modal is not fully loaded at the time the circular-slider is rendered. This article states correctly that the offsetPosition is null if the document (in this case, the modal) is not finished loading

Ionic app sidemenus don't work after closing $ionicPopup

The Ionic app I'm working on displays a $ionicPopup when it starts and after closing the popup, the two sidemenus the app contains don't work at all. If I remove the popup from the code, the sidemenus work well.
Does anyone have an idea what the problem could be?
Add the following code to the controller that contains the slidebox:
$scope.$on('$ionicView.enter', function(){
$ionicSlideBoxDelegate.update();
})
I had the same problem than you. I resolved with this.
Solution
I was facing this same problem.
In my case, this was happening because, the enable-menu-with-back-views="true" option in ion-side-menu was set false.
It got back to work when setting it to true. =)

Debugging jquery mobile on Eclipse

So I'm learning jQuery Mobile and I'm trying to run the following code below in my Android emulator. What I was trying to do is to use $.mobile.changePage() method to navigate to my Contacts page (contact.html). Obviously I'm doing something wrong, because I'm not even seeing the alert() call I placed into my JS.
I'm using jquery.mobile-1.0.min.css, jquery-1.6.4.min.js, and jquery.mobile-1.0.min.js in my html file.
I have an html5 button tag with an id of "html5Btn" in my code. I have wrapped that button in a "div" with a data-role='content' attribute.
Can someone explain...
What I'm doing wrong in my code?
How do I debug JS in Eclipse? I'm not seeing any errors in my LogCat? Is this where I even look for jQuery errors?
//CHANGE PAGE USING changePage()...placed this code
$("#html5Btn").bind('click', function(event) {
alert("in JS");
$.mobile.changePage('contact.html');
}, false);
try
//CHANGE PAGE USING changePage()...placed this code
$("#html5Btn").live('click', function(event) {
alert("in JS");
$.mobile.changePage('contact.html');
}, false);
For debugging, firebug is your friend! Also, I'm using intellij 11 ultimate... I must say the javascript debugger is nice!