Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

selectmenu refresh is not working #2422

Closed
MauriceG opened this issue Sep 11, 2011 · 20 comments
Closed

selectmenu refresh is not working #2422

MauriceG opened this issue Sep 11, 2011 · 20 comments
Assignees

Comments

@MauriceG
Copy link
Contributor

Starting with jqm latest around the 08.08.2011 the selectmenu.refresh method is not working as expected.

ajax-loaded options are visible in the selectmenu, but are not selectable.
With jqm latest from 07.08.2011 it works but in B3 still not.

example code:
$("#id_selectmenu").load("dataquery.php", { what: "some" }, function(){ $("#id_selectmenu").selectmenu('refresh', true); });

@johnbender
Copy link
Contributor

MauriceG

Your code snippet appears to have been mistreated by the markdown parser. Can you provide a jsbin or jsfiddle sample of your issue instead?

@ghost ghost assigned johnbender Sep 12, 2011
@MauriceG
Copy link
Contributor Author

ok. here is a simple demo without ajax:

http://jsfiddle.net/MauriceG/7u9CV/3/

@johnbender
Copy link
Contributor

@MauriceG

Have you tried this with HEAD? If not could you? I believe I corrected this last week.

@MauriceG
Copy link
Contributor Author

@johnbender

i hope, you don't mean my head head
yes. i have tried a lot and the page i use the refresh method in, has a complete head.
the "fiddle" has a head too, but it was not shown. May a typo.
i have reviewed the fiddle-demo and made it to base and now the head-source is shown.
http://jsfiddle.net/MauriceG/7u9CV/
you can also look at http://www.maugo.de/jqmb3/refresh.html

as i described earlier, if i use the jquery mobile latest from 07.08.2011 it works fine...

@MauriceG
Copy link
Contributor Author

@johnbender

btw this is no problem with non-native-select menus too (like issue 2424...)

@johnbender
Copy link
Contributor

@MauriceG

I meant the latest commit to master on the repository, ie can you try it with the latest snapshot. HEAD refers to the pointer to the latest/current commit on a given branch.

@johnbender
Copy link
Contributor

@MariceG

You can find/test the latest at:

http://jquerymobile.com/download/

Toward the bottom under Daily

@MauriceG
Copy link
Contributor Author

@johnbender

i'm sorry but i don't get you... Still i don't know what's the HEAD is ... :-(
And i don't know how to try the latest snapshot.
I have tried some of the nightly builds. No result.

btw: is it right that http://code.jquery.com is not more updated since first release of B3?

@johnbender
Copy link
Contributor

@MuaruiceG

No worries! Steps to test with the latest.

  1. visit http://jquerymobile.com/download/
  2. scroll down the section "Latest and daily builds"
  3. Copy and paste the three tags there in to the head of your document in the place of your current equivalents
  4. Test the select menu refresh

@MauriceG
Copy link
Contributor Author

@johnbender

ok. i've tried this already but i've updated the fiddle now at http://jsfiddle.net/MauriceG/7u9CV/ to use the "Latest and daily builds" as described.
i've also added a function that shows, that if you change the selectmenu, the selected option could be "catched", but the select item is not
synchronized.

@MauriceG
Copy link
Contributor Author

@johnbender

i have added a button to the fiddle at http://jsfiddle.net/MauriceG/7u9CV/ now, to switch the selectmenu opacity-style from 0 to 1 and vice versa.
it seems, it is just a style issue ...

@johnbender
Copy link
Contributor

@MauriceG

I'm going to close this issue, go ahead and open a separate one for the styling with an explanation and the fiddle you've included if you feel its necessary.

@MauriceG
Copy link
Contributor Author

@johnbender

i recognize, when checking the dom of a page with a programmatic-filled, native-selectmenu in,
that jquery mobile do not write the first select-option to the programmatic-preceded ui-btn-text-span when the select menu is filled ...
But okay. Thanks.

addendum 17.09.11: with latest from 16.09.2011 now native-selectmenus working fine again. Good work again! Good work!

@snez
Copy link

snez commented Oct 4, 2011

This doesn't seem to work on rc1 either, can someone verify?

@MauriceG
Copy link
Contributor Author

MauriceG commented Oct 5, 2011

@johnbender

Hi! Could you please take a look again? The demo works fine, but if you first click the select without loading values before
and then press the load-options-button, the select does not open anymore.

@johnbender
Copy link
Contributor

@snez @MauriceG,

When I go to the fiddle and click the select first, then click the "load data into selectmenu" button, the options are loaded and the select works fine in Firefox/Chrome. Which browser are you seeing the issue in?

@johnbender
Copy link
Contributor

@snez

A sample of your issue would be helpful here.

@MauriceG
Copy link
Contributor Author

MauriceG commented Oct 5, 2011

I use safari 5.0.5 on windows.

With the actual chrome browser and Safari 5.1 on Mac OS, it works as you described.
With FF 6.0.2 on windows, after clicking the select first, an empty select is shown and i have to click the load button twice to populate the selectmenu,

@MauriceG
Copy link
Contributor Author

MauriceG commented Oct 5, 2011

I've tried now with Safari 5.1 on Windows 7, Safari on iPad2 und iPhone4.
It works. So only Safari 5.0 have this issue.

@snez
Copy link

snez commented Oct 6, 2011

My test code seems to work, so probably doing something wrong. Heres the test code anyway for other peoples reference:

<html>
<head>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0rc1/jquery.mobile-1.0rc1.min.css" />
<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0rc1/jquery.mobile-1.0rc1.min.js"></script>
<script type="text/javascript">
function change() {
$('#test').html('<option value="1">1</option><option value="2">2</option>');
$('#test').selectmenu();
}
</script>
</head>
<body>
<div data-role="page">
<select id="test">
<option value="">please select</option>
</select>
<button value="Change" onclick="change()">change</button>
</body>
</html>

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

No branches or pull requests

3 participants