Created
March 25, 2018 04:53
-
-
Save camilamoreiradev/fad437d8aed4c351dcfe5908e045d69f to your computer and use it in GitHub Desktop.
Aprenda a adicionar popovers e badges nas consultas do Scriptcase.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Seguem os eventos e seus respectivos códigos: | |
-> onScriptInit: | |
-------------------------------------------------------------------- | |
sc_include_lib("Jquery"); | |
?> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" /> | |
<style> | |
.badge-info { | |
background-color: #659be0 !important; | |
} | |
</style> | |
<?php | |
-------------------------------------------------------------------- | |
-> onRecord: | |
-------------------------------------------------------------------- | |
sc_select(rs, "SELECT COUNT(*) AS QTD FROM orders WHERE employeeid = ".{employeeid}); | |
{pedidos} = '<span class="badge badge-info"> '.$rs->fields[0].' </span>'; | |
$cm_titulo = {firstname}." ".{lastname}; | |
$cm_descricao = "<strong>Notas:</strong> ".{notes}; | |
{detalhes} = '<h5> | |
<a href="#" data-trigger="hover" data-toggle="popover" title="<strong>'.$cm_titulo.'</strong>" data-content="'.$cm_descricao.'"> | |
<span class="glyphicon glyphicon-option-vertical"></span> | |
</a> | |
</h5>'; | |
-------------------------------------------------------------------- | |
-> onFooter: | |
-------------------------------------------------------------------- | |
?> | |
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> | |
<script> | |
$( document ).ready(function() { | |
setInterval(function(){ | |
$('[data-toggle="popover"]').popover({html: true}); | |
}, 1000); | |
}); | |
</script> | |
<?php | |
-------------------------------------------------------------------- | |
Bom uso pessoal! | |
Obs.: Se possível deixe um comentário abaixo para eu saber se está tendo uso o código e ter motivação para postar mais dicas. ;) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Muito boa sua ajudar e seus códigos me ajudaram muito. Valew Camila!!