javascript - Dynamically populated select menu on html page to be displayed on android webview without using jquery mobile -
I have created a web app using Google App Script and put it on the web. This application works well on PC, but when I load it on the webview on Android, dynamically populated & lt; Select & gt;
The menus are not displayed (they are empty).
I know that google caja has an issue from jquery mobile, so i can not use jquery mobile
The question is if & lt; Select & gt;
Is there any way to work the menu only using jquery or javascript? Or maybe I can do some tricks in Android?
Here is an example of how I populate menus by jquery:
function addClients (Client) {// Array Google Spreadsheets option. $ ('# Customer') below (); (Var i in client) {$ ('# client'). Append ('& lt; option & gt;' + client [i] + '& lt; / option & gt;'); . $ ('# Customer') Triggers ("Chosen: Update"); }}
HTML Part:
& lt; Select name = "client" id = "client" data-native-menu = "true" data-role = "none" & gt; & Lt; Options & gt; ---- Choose a customer ---- & lt; / Option & gt; & Lt; / Select & gt;
Android part:
WebView myWebView = (webview) Find VVBID (RD.Web Wi1); MyWebView.loadUrl ("--- URL of my web app here ---"); MyWebView.setWebChromeClient (New WebChromeClient ()); WebSettings webSettings = myWebView.getSettings (); WebSettings.setJavaScriptEnabled (true);
Thank you in advance.
Edit:
It looks like the menu is not refreshing. Initially, I have a built-in option:
& lt; Options & gt; ---- Choose a customer ---- & lt; / Option & gt;
This option has been removed in the jquery part, but then the menu has not been updated, it remains empty.
I have not received any positive results in advance:
$ ('# client'). Trigger ("Selected: Updated"); $ ('Refresh') (Select 'Select') selectmenu. Hide $ ('#Customers'). $ ('#Customer') Show (). $ ('Featured # Customer') selectmenu ('Refresh').
I solved the problem and commented on the line I did , Which has emptied the selection menu and used jquery ui for my purpose:
function addClients (client) {// Google's array of options from Google Spreadsheets // $ ('# Customer ') below () .; ---------- I made this comment. (Var i in client) {$ ('# client'). Append ('& lt; option & gt;' + client [i] + '& lt; / option & gt;'); // $ ('# client'). Trigger ("Selected: Update"); ------- This line has also been removed $ $ (function () {// and added jquery ui select menu $ ("#client") .selectmenu ();}); }
I'm not sure why this works ...
Comments
Post a Comment