cordova-plugin-themeablebrowser icon indicating copy to clipboard operation
cordova-plugin-themeablebrowser copied to clipboard

Add Menu Items Dynamically

Open Sonal824 opened this issue 8 years ago • 0 comments

Hello, this plugin works great for me in static data. but i want to make Menu items dynamic so i passed Json Object Data in menu items. but its not working. can you help me with it.

Here is my code: var items_html = []; items_html.push({event: "helloPressed" , label: "test1"}); items_html.push({event: "testPressed" , label: "test2"});

var this_b = cordova.ThemeableBrowser.open(url_to_open, '_blank', { customButtons: [ { image: 'ic_action_remove', imagePressed: 'close_pressed', align: 'right', event: 'closeactionPressed' }, ], menu: { image: 'ic_action_remove', imagePressed: 'menu_pressed', title: 'Test', cancel: 'Cancel', align: 'left', items: JSON.stringify(items_html) }, }).addEventListener('closeactionPressed', function(event) { this_b.close(); }).addEventListener('helloPressed', function(e) { alert('Add dynamic redirect url here'); }).addEventListener('testPressed', function(e) { alert('Add dynamic redirect url here'); });

Sonal824 avatar Mar 03 '17 07:03 Sonal824