Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- As an example you can get the latest from the samples directory from the bbUI repo and modify the following
- index.htm - add the following code to the ondomready function
- if (params) {
- alert('foo = ' + params.foo);
- }
- js/dataOnTheFly.js - Modify the dataOnTheFly_addListItem() function to look like the code below
- function dataOnTheFly_addListItem() {
- var listItem, container, dataList = document.getElementById('dataList'),
- data = {'foo': 'bar'};
- // Create our list item
- listItem = document.createElement('div');
- listItem.data = data;
- listItem.setAttribute('data-bb-type', 'item');
- listItem.setAttribute('data-bb-img', 'images/icons/icon11.png');
- listItem.setAttribute('data-bb-title', 'Title ');
- listItem.innerHTML = 'My description';
- listItem.onclick = function() {
- bb.pushScreen('grid.htm', 'grid', listItem.data);
- }
- // Append the item
- dataList.appendItem(listItem);
- }
- Now when you open this page (shown on the main menu as "Load Data After Showing") in the sample app and click on one of the generated list items it will open the grid list screen and the ondomready function will do an alert with the text "foo = bar"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement