Posted in Javascript, JQuery, JSON, NOTY

Javascript – Yes / No NOTY buttons

function deleteDocs () {

var uploadid = <?php echo ($uploadid); ?>;

$.noty.closeAll()

var n = noty({

text : ‘<?php echo $translation->getValue(“CESDoyouwanttoDELETEyourUPLOADEDDOCUMENTSfromthedatabase”)?>’,
type : ‘confirm’,
dismissQueue : false,
layout : ‘top’,
theme : ‘defaultTheme’,

buttons : [

{addClass: ‘btn btn-success’, text:'<?php echo (“Yes”)?>’, onClick:

function($noty) {

$noty.close();

$.post(‘inl_sev_066_J_ver.php’,{“UPLOADID” : uploadid,

“event” :’STOOR’}, function(response) {

// alert (“Javascript object – response : ” + JSON.stringify(response, null, 4));

if (response[0].success == “Y”) {

$.noty.closeAll();

var n = noty({
dismissQueue: false,
timeout : 2000,
text : response[0].message,
type : ‘success’,
layout : ‘top’
});

} else {

$.noty.closeAll();

var n = noty({
dismissQueue: false,
text : response[0].message,
type : ‘error’,
layout : ‘top’
});

}

}, ‘json’)

}

}, // YES Button

{addClass: ‘btn btn-danger’, text:'<?php echo (“No”)?>’, onClick:

function($noty) {

$noty.close();

noty({text:'<?php echo (“Cancelled”)?>’, type: ‘error’,timeout:1000});

} // “NO” Button

}

] // Noty button array

}) // Noty

}

Posted in EasyUI, Javascript, NOTY

The EasyUI Datagrid

UploadedDocsList

function wysTabelPDF(){

var questionnaire = “<?php echo $questionnaire ?>”;
var version = “<?php echo $version ?>”;
var tak = “<?php echo $tak ?>”;

$(‘#myGrid’).datagrid({

columns:[[

{field:’_UPLOADID’, title:'<?php echo ‘CESUploadid’ ?>’},

{field:’view’, title:'<?php echo ‘CESViewdoc’ ?>’,align:’right’},
{field:’delete’, title:'<?php echo ‘CESDelete’ ?>’,align:’right’},

]],

title : ‘<?php echo “CESCentralEvaluationSystemUploadedDocuments”?>’,
singleSelect: true,
striped : true,
fitColumns : true,
pagination : true,

width : ‘80%’,
height : ‘300px’,

url : ‘inl_sev_061_J_afl.php?TAK=’ + tak + ‘&QUESTIONNAIRE=’ + questionnaire + ‘&VERSION=’ + version,

onLoadError : function(data) {

var $notyE = [];
$notyE[‘message’] = ‘<?php echo (“Error fetching records”) ?>’;
$notyE[‘position’] = ‘top’;
$notyE[‘timeout’] = false;
$notyE[‘type’] = ‘E’;
show_noty($notyE);

}

});

$(‘#myGrid’).datagrid(‘enableFilter’);

}