-
Notifications
You must be signed in to change notification settings - Fork 2.4k
add some info in docs on rendering custom-select loaded in with Ajax #4297
Comments
Hi @frequent ! |
Hi @MauriceG ok. This is for a registration form with 3 types of accounts. The inital page just has a radio with type A,B,C. On change, I'm pulling the respective forms from a file called registry.cfm My function binding an call:
Ajax call (and I'm still experimenting with the CSS3 effects and overall settings):
I want to set data-native-menu depending on support.touch, so I can't just write it into the markup. As I'm calling trigger create after pulling in the data, the question would be, if I can somehow add data-native-menu before calling trigger('create') the first time. Should also work and would save a chunk of code. So to your question. I'm rendering after the data has arrived. Not sure what's better - sending a big chunk of enhanced data or processing it on the device. For now, I'm sending pre-enhanced markup. |
the ajax call is asynchronous |
Du bist ja in meiner Zeitzone ! |
hello neighbours! Maybe this fiddle helps you: http://jsbin.com/itikad/8/ Good night all ... zzzzz |
@MauriceG - und Du in meiner :-) Danke für die Infos. Ich verlasse jetzt die Zeitzone.add( @uGoMobi ).goodnight() |
function call succeded ... system is down ... |
@uGoMobi - not quite, but I have found a nicer solution: When the Ajax call returns data (my html form), I'm now doing this:
So I gues because the select box received the initial trigger('create') treatment without *data-native-menu, triggering it a 2nd time did not do anything. Come to think, I lock up some plugin elements, too, so they are not re-enhanced multiple times in case some events bubble around in the DOM. Anyway, I'm having a nice customselect menu now. Thanks for help! Regarding the issue: Would it make sense to add info to the docs, that dynamically generated selects need trigger('create') vs. dynamically modified selects need *selectmenu('refresh')? Otherwise we should close this again. |
hi @frequent Great that you managed to get the custom select the way you wanted! Regarding the docs; the information is there (http://jquerymobile.com/test/docs/forms/docs-forms.html) but maybe it is not clear enough. I noticed in other threads too that people don't know what to use. @agcolom and @MauriceG are doing a great job on improving all the docs. Maybe they can give it a look. |
@uGoMobi - Can this issue be closed now that the PR has landed? |
The original issue "add some info in docs on rendering custom-select loaded in with Ajax" stil stands. This issue has been referenced in a comment on that PR because we could use the examples of its test page for this. I suggest to close this issue anyway, because the thread is off topic. We could open new ticket for "adding dynamically injected content examples (code + result) to docs". |
@uGoMobi - I agree. Mind creating a new ticket for that? |
I more or less got desperate trying to enhance a custom select menu pulled in via Ajax. The docs say forcing a rebuild can be done by
but while this seems to work with static content, dynamic elements don't play along (for example here, here ).
I tried to render a customselect which I had pulled in via Ajax. The only way it worked inside my success-handler is like this: :
I have pretty much tried calling everything in the book on the wrapping ui-btn, ui-select and the select itself.
I could only get the Ajax-in select to render correctly with the above clone and split up order. Using any of the other methods or trying to chain breaks it again.
Not sure this really is a bug, but it sure is difficult and maybe deserves a look or some more info in the docs.
The text was updated successfully, but these errors were encountered: