Skip to content

Commit

Permalink
🔨 APP #275
Browse files Browse the repository at this point in the history
  • Loading branch information
bjverde committed Sep 23, 2022
1 parent 060c1ce commit 21fd280
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions appexemplo_v1.0/modulos/tree/exe_tree_view_6_check.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,17 @@

$frm->addGroupField('gpTree', 'Exemplo Treeview', null)->setcloseble(true);

$tree = $frm->addTreeField('tree', null, null, null, null, null, null, null, null);
$tree = $frm->addTreeField('tree'
, null
, 'treecheck_link'
,'ID_PAI'
,'ID'
,'NOME'
, null
, null, null);
$tree->setStartExpanded(true);
$tree->enableCheck(true);

$tree->addItem(null, 1, 'Relatório', true);
$tree->addItem(1, 11, 'Financeiro, tem hint', true, 'Meu Hint', array('URL'=>'www.bb.com.br'));
$tree->addItem(1, 12, 'Recursos Humanos', null, null, array('URL'=>'www.google.com.br'));
$tree->addItem(null, 2, 'Arquivos', true);
$tree->addItem(2, 21, 'Documentos', null, 'Documentos do órgão', array('MODULO'=>'modulos/cad_documento'));
$tree->addItem(2, 22, 'Planilhas');
for ($i=23; $i<30; $i++) {
$tree->addItem(2, $i, 'Nivel teste '.$i);
}
$tree->setOnCheck('treeCheck'); //Função chamada ao checar o item
//$tree->setOnCheck('treeCheckOld'); //Função chamada ao checar o item
$frm->closeGroup();
Expand All @@ -82,6 +80,20 @@
<script>
function treeCheck(id, state){
alert( state );
jQuery.ajax({
type: "POST"
,url: "includes/treeview_salvar_check.php"
,data: "id="+id+'&checked='+state
,success: function(msg){
msg = jQuery.trim(msg);
if( msg ){
alert( msg );
}
}
,error: function(msg){
alert( 'erro:' + msg );
}
});
}
function treeCheckOld(id) {
var checkState = treeJs.isItemChecked(id);
Expand Down

0 comments on commit 21fd280

Please sign in to comment.