evento onscriptinit aplicação controle:
echo "
<link rel=\"stylesheet\" type=\"text/css\" href=\"../_lib/mylibs/keyboard/css/keyboard.css\">
<script type=\"text/javascript\" src=\"../_lib/mylibs/keyboard/js/jquery.keyboard.js\"></script>
<script type=\"text/javascript\" src=\"../_lib/mylibs/keyboard/js/jquery.mousewheel.js\"></script>
<script type=\"text/javascript\" src=\"../_lib/mylibs/keyboard/js/jquery.keyboard.extension-typing.js\"></script>
<script type=\"text/javascript\" src=\"../_lib/mylibs/keyboard/js/jquery.keyboard.extension-autocomplete.js\"></script>
<link rel=\"stylesheet\" type=\"text/css\" href=\"../_lib/mylibs/keyboard/css/jquery-ui.css\">
<style type=\"text/css\">
body { font-size: 14px; margin-top: 200px; }
#wrap { display: block; margin: 0 auto; width: 200px; }
</style>";
$_sql="SELECT
concat('\"',group_concat(distinct o.login order by o.login SEPARATOR '\",\"' ),'\"') as users
FROM
sec_users o INNER JOIN venda v ON o.Id = v.operador_id
WHERE
date(v.datahora) between SUBDATE(current_date(), INTERVAL 60 DAY) and current_date()";
sc_lookup(ds,$_sql);
if (!empty({ds})) {
$_users=$ds[0][0];
}
echo "
<script type='text/javascript'>
var availableTags = [$_users];
</script>
";
método javascript: parâmetro: function TecladoVirtual(availableTags)
$('#id_sc_field_login')
.attr('placeholder',"Entre com seu Login...")
.keyboard({
layout : 'custom',
customLayout: {
'default': [
'1 2 3 4 5 6 7 8 9 0 {bksp}',
'{tab} q w e r t y u i o p',
' a s d f g h j k l {enter}',
'{shift} z x c v b n m @ {shift}',
' {space} {left} {right} {cancel}'
],
'shift': [
'1 2 3 4 5 6 7 8 9 0 {bksp}',
'{tab} Q W E R T Y U I O P',
'A S D F G H J K L {enter}',
'{shift} Z X C V B N M @ {shift}',
'{space} {left} {right} {cancel}'
]
},
autoAccept: true,
tabNavigation: true,
enterNavigation: true,
visible: function(e, keyboard, el) {
keyboard.$preview[0].select();
}
})
.autocomplete({
source: availableTags
})
.addAutocomplete()
.addTyping({
showTyping: true,
delay: 300
})
$('#id_sc_field_pswd')
.attr('placeholder',"Entre com sua Senha...")
.keyboard({
layout : 'custom',
customLayout: {
'default': [
' 1 2 3 4 5 6 7 8 9 0 {bksp}',
'{tab} q w e r t y u i o p',
' a s d f g h j k l {enter}',
'{shift} z x c v b n m @ {shift}',
' {space} {left} {right} {cancel}'
],
'shift': [
'1 2 3 4 5 6 7 8 9 0 {bksp}',
'{tab} Q W E R T Y U I O P',
'A S D F G H J K L {enter}',
'{shift} Z X C V B N M @ {shift}',
'{space} {left} {right} {cancel}'
]
},
autoAccept: true,
tabNavigation: true,
enterNavigation: true,
})
javascript evento onload:
function sc_form_onload()
{
TecladoVirtual(availableTags);
}
download plugin jquery:
http://www.jquerybyexample.net/2012/04/jquery-ui-virtual-keyboard-plugin.html
TAGS: Teclado Virtual, iwh