Rabu, Januari 26, 2011

JQuery : Delete row and fade out the row affected

Case : You want to delete row without refreshing whole page
Solution : Use JQuery


function hapus(id){
if (confirm('Yakin mau dihapus ???')) {
$.post('actions/hapus_pengeluaran.php', {id: +id, ajax: 'true' },
function(){
$("#row_"+id).fadeOut("slow");
});
}
}


Source : http://www.bitsntuts.com/css/simple-jquery-delete-table

Selasa, Januari 18, 2011

Blogger : Add Syntax Highlighter

Supported language : http://code.google.com/p/syntaxhighlighter/wiki/Languages

Source : http://heisencoder.net/2009/01/adding-syntax-highlighting-to-blogger.html

Javascript : Format number function

Case : You want to display format number in javascript
Solution :


function formatNumber (num,dec,thou,pnt,curr1,curr2,n1,n2) {
var x = Math.round(num * Math.pow(10,dec));if (x >= 0) n1=n2='';var y = (''+Math.abs(x)).split('');
var z = y.length - dec; if (z<0) i =" z;" z =" 1;"> 3) {
z-=3; y.splice(z,0,thou);
}
var r = curr1+n1+y.join('')+n2+curr2;
return r;
}


Source : http://javascript.about.com/library/blnumfmt.htm

Jumat, Januari 14, 2011

JQuery : Autocomplete hidden input, Autocomplete multiple field



Kamis, Januari 06, 2011

JQuery : Autocomplete not working with Date picker





















Solution : load datepicker before autocomplete.