jquery mobile error undefined call - jquery-mobile

Two problems that i am facing using jquery mobile link then when i am scrolling or do any actions on page its getting me this error many times.
jquery.mobile-1.3.2.min.js Uncaught TypeError: Cannot call method 'call' of undefined main.js:4
jquery.mobile-1.3.2.min.js Uncaught TypeError: Cannot call method 'call' of undefined main.js:4
Uncaught TypeError: Cannot call method 'call' of undefined
Second problem when i am using locally jquery mobile js and css file and add in my project
so images are not showing on buttons like back arrow on back button all images not availabe on any component like list views on all kind of stuff.

This answer for your second problem add the below images ajax-loader,icons-18-black,icons-36-black into following directory
Your Project Folder
---CSS Folder
---create images folder
----Add the above images

Related

Quasar Dialog Plugin fails to load with "TypeError: Cannot read properties of null (reading 'show')"

I'm trying to open a dialog from a separate component using the Quasar Dialog Plugin method described here, but when I click the button that should open the dialog, I get the following error in the console:
TypeError: Cannot read properties of null (reading 'show')
The solution was to add ref="dialogRef" to the opening <q-dialog> tag of my dialog component as shown here.
Here's a screenshot of the diff that got it working:
As you can see in the screenshot, I was also missing the #hide handler and the class="q-dialog-plugin" class on the opening <q-card> tag, but those wouldn't have prevented the dialog from loading (I checked).

Struggling with pagecontainer

I want to programmatically change my jquery mobile page. I have read stackoverflow pages here
https://stackoverflow.com/a/24173950/4278933
jQuery mobile pagecontainer load()
and failed to get my code working. Sometimes I get an error on the console, sometimes I get nothing (no url change, gui change or console log output).
(Note, I am navigating TO f.html which is an external page).
All attempts to change the page are done AFTER device ready...
First method I tried was
Front
and then I triggered
$("#front").trigger("click");
With the above, nothing worked (no error or url change). However, manually clicking on the link achieved the page change I wanted.
Then I read
http://api.jquerymobile.com/pagecontainer/#method-change and combined with the two SO posts noted above, I tried
$( ":mobile-pagecontainer" ).pagecontainer( "load", "f.html" );
and also tried
$( "body" ).pagecontainer( "load", "f.html");
I get Error: cannot call methods on pagecontainer prior to initialization; attempted to call method 'load'
Where am I going wrong?
Because you don't want AJAX loading and you really want the browser to navigate to the new page (without loading it into the current DOM), you can just use the normal JavaScript Window.location object:
location.assign("f.html");
DEMO

How to know which button the user selected on <paper-dialog>?

Given this simplified version of my template:
<template>
<paper-dialog id='dialog_alert' heading="{{title}}">
<p>{{alertText}}</p>
<paper-button on-tap='{{btnAffirmative}}' label='Yes' affirmative autofocus></paper-button>
<paper-button on-tap='{{btnNegative}}' label='No' dismissive></paper-button>
</paper-dialog>
</template>
I'm having trouble finding how how to see which button the user selected after the dialog closes. It doesn't appear that the dialog itself provides any event for it, so I just hooked "on-tap" events onto to the buttons and that seems to work. However, when I use this approach the paper-button element throws up after the click:
Uncaught Uncaught Error:
Bad state: controller overlay-host is not a Dart polymer-element.
When I take the "on-tap" hooks out, no exception, but then I have no idea which button the user pressed. I'm hoping I overlooked something obvious in the documentation.
I should note that, even with the exception, the program continues to execute fine, so I'm just rolling with using the on-tap events for now.
Basically your approach seems fine. The affirmative, dismissive attributes have only influence on where they are added to the dialog (see where and how it is used in the source )
I suppose the error is caused by the Dart wrapper for the JS polymer elements. I would create a bug report at http://github.com/dart-lang/paper-elements.
You could try on-click instead of on-tap because on-tap is a polyfill event - just to be sure.

FullCalendar integrated with HighCharts

Has anyone successfully integrated HighCharts with FullCalendar?
Currently I display data in a monthly view using text. I would like to replace them with pie charts generated by the HighCharts js library.
The FullCalendar uses a EventSource to load the events. I send JSON serialized data from my MVC controller. To enable HTML in the Event Title I use the solution mentioned here
I tried using the DotNet.HighCharts library and returning the chart.ToHtmlString() as the event title, but I keep getting the js error below:
Unhandled exception at line 117, column 483 in
/Scripts/Highcharts-2.3.5/js/highcharts.js
0x800a138f - JavaScript runtime error:
Unable to get property 'length' of undefined or null reference
I got this to work. The problem was with the DotNet.HighCharts library. The chart script that is was returning (chart.ToHtmlString()) had issues with the latest version of the HighCharts JS scripts. Instead I removed the DotNet.HighCharts library and constructed the Chart JS script in my controller and it works fine.

Is there an alternative to using Gmaps.loadMaps when loading HTML/JS that contains Gmaps4Rails via AJAX?

I'm using Gmap4Rails in the body of a form that is loaded via Ajax. There are custom fields in the form and some of them may be location pickers that I have working on a non-Ajax version of the form.
With the Ajax version of the form, I'm getting "Gmaps.my_map_id" undefined errors.
In the non-Ajax version of the form, I call Gmaps.loadMaps via JavaScript in the HTML page head for "window.onload" as is the normal practice with Gmaps4Rails.
However, this won't work in the context of Ajax, as the map(s) haven't been defined at window.onload time.
In my form, I also define a callback per Gmaps map object. This is what seems to be failing with the "undefined" error, even when I do a "Gmaps.loadMaps();" script directly before the first callback is defined in the code that is loaded by Ajax.
Basically it goes like this in code order:
in a loop, gmaps4rails partial is called to output each map custom field
after that loop finishes, Gmaps.loadMaps() is called once
in another loop, each Gmaps map object has the JS for its callback added
Any suggestions on how to get this working?
UPDATE: possibly only partly correct (i.e. I did have the problem that was outlined here, but calling Gmaps.loadMaps() still doesn't work).
2nd Update: I have had to alter the definition of the load_... to be on the Gmaps object and then alter Gmaps.loadMaps function accordingly. I've put in a pull request to the project at https://github.com/apneadiving/Google-Maps-for-Rails/pull/94.
The Gmaps.loadMaps() call wasn't the issue. So an alternative isn't necessary. The thing that was tripping me up is that in the partial enable_js was being called as false and the JavaScript that declares the new instance of the Gmaps4RailsGoogle and the function for loading it was not being called.
I have a custom version of the partial and in my case, even when enable_js (I interpret as "don't load javascript library files" for my app) is false, I still do the JavaScript that declares the new Gmaps4RailsGoogle instance and defines the load_... function.
That being said, the load_... function appears to be not working for me. It comes back with the following in my case:
TypeError: 'undefined' is not a function (evaluating 'window"load_" + key')
When I call the load_... function directly from the console (rather than the Gmaps.loadMaps call), I get a similar error:
"'undefined' is not a function (evaluating 'this.load_...()')"
Perhaps having to do with not having any markers declared? Any hints on that problem appreciated.
If I step through the steps in the load... function, the first bit that throws an error is .initialize(). Still investigating.

Resources