Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jqmData("iscrollview") always null in jQm 1.3.0 #76

Closed
vineey opened this issue Mar 4, 2013 · 4 comments
Closed

jqmData("iscrollview") always null in jQm 1.3.0 #76

vineey opened this issue Mar 4, 2013 · 4 comments

Comments

@vineey
Copy link

vineey commented Mar 4, 2013

using jQm 1.2.0 is working fine, but when i tried to switch to jQm 1.3.0, encountering this issue with jqmData("iscrollview"), it is always returning null, already upgraded from 1.2.5 to 1.2.6 of this plugin, issue still persist. I think it has to update to work with jQm1.3.0 regarding this matter.

@ghost
Copy link

ghost commented Apr 4, 2013

This is indeed a bit broken due to changes made in jQuery and jQuery Mobile. But there is a (bit off a) workaround:

With this code I managed to get a simmiliar result with the old jqmData( "iscrollview" )

iscroll_view_obj = $( 'iscroll_view_target' ).iscrollview();
if( iscroll_view_obj[0] != undefined )
scrollObject = $( iscroll_view_obj[0] ).data( "mobileIscrollview" );

It doesnt really feel like a good sollution, but it works for me for now.

@jtara
Copy link
Member

jtara commented Apr 15, 2013

I don't understand what iscroll_view_target and mobileIscrollview are in the above. There seems to be something missing. Are these classes in your HTML?

@jtara
Copy link
Member

jtara commented Apr 16, 2013

Confirmed.

I'll update the documentation. Nothing I can do about this in the widget, since the way JQM uses the Widget Factory has changed.

I think you meant:

iscroll_view_obj = $( '.iscroll_view_target' ).iscrollview();

above, where .iscroll_view_target is the class of your wrapper element.

If you want to write application code that will work with either JQM 1.3 or <1.3, you could do this:

$scrollElement = $(iscroll_view_obj[0]);
scrollObject = $scrollElement.data("mobileIscrollview") || $scrollElement.jqmData("iscrollview");

Note that jqmData doesn't work to retrieve this with JQM 1.3. So, it is a change both in the naming convention and in the method used to access.

jtara added a commit that referenced this issue Apr 17, 2013
Don't count headers/footers in popups or panels when calculating wrapper height.

Updated documentation for Issue #76
@jtara jtara closed this as completed Apr 17, 2013
@ghost
Copy link

ghost commented Apr 17, 2013

With 'iscroll_view_target' I ment the element where the iscroll_view plugin was created on. So yeah that could be a class or an id or anything.

(Sorry for the kinda slow response, not getting this in my email for some reason :) )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants