Does anybody use the w2ui.com component library? There is a cool input component (called combo) that filters a list as you type.
But it doesn't seem to work when it is inside of a popup. When you type in the input box, nothing appears in the filter like it does in the demo.
Here is my javascript:
function openAddSymbolPopup() {
w2popup.open({
title : 'Add Symbol',
body : '<div style="height: 25px"></div>' +
'<div class="w2ui-field w2ui-span3">' +
'<label>Symbol:</label>' +
'<div> <input type="combo"><span class="legend"></span> </div>' +
'</div>' +
'<div style="height: 20px"></div>',
buttons : '<button class="w2ui-btn" onclick="w2popup.close();">Close</button> '+
'<button class="w2ui-btn" onclick="addSymbolToDatabase()">Add</button>',
width : 250,
height : 170,
overflow : 'hidden',
color : '#333',
speed : '0.3',
opacity : '0.8',
modal : true,
showClose : false,
});
}
var people = ['George Washington', 'John Adams', 'Thomas Jefferson', 'James Buchanan', 'James Madison', 'Abraham Lincoln', 'James Monroe', 'Andrew Johnson', 'John Adams', 'Ulysses Grant', 'Andrew Jackson', 'Rutherford Hayes', 'Martin Van Buren', 'James Garfield', 'William Harrison', 'Chester Arthur', 'John Tyler', 'Grover Cleveland', 'James Polk', 'Benjamin Harrison', 'Zachary Taylor', 'Grover Cleveland', 'Millard Fillmore', 'William McKinley', 'Franklin Pierce', 'Theodore Roosevelt', 'John Kennedy', 'William Howard', 'Lyndon Johnson', 'Woodrow Wilson', 'Richard Nixon', 'Warren Harding', 'Gerald Ford', 'Calvin Coolidge', 'James Carter', 'Herbert Hoover', 'Ronald Reagan', 'Franklin Roosevelt', 'George Bush', 'Harry Truman', 'William Clinton', 'Dwight Eisenhower', 'George W. Bush', 'Barack Obama'];
people.sort();
$('input[type=combo]').w2field('combo', { items: people });
Could there be some kind of undocumented limit to the amount of html you can put in the popup body tag?
EDIT: This one works. Type in the box and see filtered list below it.
The code snippet below shows it doesn't work inside a popup.
function openAddSymbolPopup() {
w2popup.open({
title : 'Add Symbol',
body : '<div style="height: 25px"></div>' +
'<div class="w2ui-field w2ui-span3">' +
'<label>Symbol:</label>' +
'<div> <input type="combo"><span class="legend"></span> </div>' +
'</div>' +
'<div style="height: 20px"></div>',
buttons : '<button class="w2ui-btn" onclick="w2popup.close();">Close</button> ',
width : 300,
height : 200,
overflow : 'hidden',
color : '#333',
speed : '0.3',
opacity : '0.8',
modal : true,
showClose : false,
});
}
var people = ['George Washington', 'John Adams', 'Thomas Jefferson', 'James Buchanan', 'James Madison', 'Abraham Lincoln', 'James Monroe', 'Andrew Johnson', 'John Adams', 'Ulysses Grant', 'Andrew Jackson', 'Rutherford Hayes', 'Martin Van Buren', 'James Garfield', 'William Harrison', 'Chester Arthur', 'John Tyler', 'Grover Cleveland', 'James Polk', 'Benjamin Harrison', 'Zachary Taylor', 'Grover Cleveland', 'Millard Fillmore', 'William McKinley', 'Franklin Pierce', 'Theodore Roosevelt', 'John Kennedy', 'William Howard', 'Lyndon Johnson', 'Woodrow Wilson', 'Richard Nixon', 'Warren Harding', 'Gerald Ford', 'Calvin Coolidge', 'James Carter', 'Herbert Hoover', 'Ronald Reagan', 'Franklin Roosevelt', 'George Bush', 'Harry Truman', 'William Clinton', 'Dwight Eisenhower', 'George W. Bush', 'Barack Obama'];
people.sort();
$('input[type=combo]').w2field('combo', { items: people });
.w2ui-overlay {
z-index: 1601 !important;
}
<link rel="stylesheet" href="http://rawgit.com/vitmalina/w2ui/master/dist/w2ui.min.css"><script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script src="http://rawgit.com/vitmalina/w2ui/master/dist/w2ui.min.js"></script>
<script src="http://w2ui.com/src/w2ui-1.5.min.js"></script>
<button onclick="openAddSymbolPopup()">w2ui Popup</button>