Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theprincy/7d1e7d8bf3fff9452ff73b89595d7de3 to your computer and use it in GitHub Desktop.
Save theprincy/7d1e7d8bf3fff9452ff73b89595d7de3 to your computer and use it in GitHub Desktop.
Aprenda a adicionar popovers e badges nas consultas do Scriptcase.
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