Membuat Format Angka pada JqGrid
Contoh : kolom QTY akan kita jadikan Fomat angka tampilanya :
jQuery("#g_lapbarangperdoc").jqGrid({
url:"main.php?action=lapbarangperdoc_data&q=lapbarangperdoc",
datatype: "json",
height: 400,
width:1500,
colNames:['JENISBCDOC', 'NOMORBC', 'TANGGALBC', 'DONO', 'RECEIPTDATE', 'SUPPLIERNAME',
'ITEMCODE', 'ITEMNAME', 'UOM', 'QTY'],
colModel:[
{name:'JENISBCDOC',index:'JENISBCDOC', sorttype:"int", width: 30, frozen : true,key : true},
{name:'NOMORBC',index:'NOMORBC', width:70, frozen : true},
{name:'TANGGALBC',index:'TANGGALBC', width:100, frozen : true},
{name:'DONO',index:'DONO', width:50, align: 'center'},
{name:'RECEIPTDATE',index:'RECEIPTDATE', width:50, width:70, align: 'right'},
{name:'SUPPLIERNAME',index:'SUPPLIERNAME', width:70, align: 'right'},
{name:'ITEMCODE',index:'ITEMCODE', width:70, align: 'right'},
{name:'ITEMNAME',index:'ITEMNAME', width:70, align: 'right'},
{name:'UOM',index:'UOM', width:70, align: 'right'},
{name:'QTY',index:'QTY', width:70, align: 'right', formatter: 'number', formatoptions: {thousandsSeparator: ",",decimalSeparator:".",decimalPlaces: 2}}
],
rowNum:15,
rowList:[15,30,45],
pager: '#p_lapbarangperdoc',
sortname: 'NOURUT',
loadonce :true,
viewrecords: true,
rownumbers : false,
ignoreCase: false,
shrinkToFit :true,
sortorder: "desc",
caption: "Report Penerimaan Barang",
height: 'auto'
});
url:"main.php?action=lapbarangperdoc_data&q=lapbarangperdoc",
datatype: "json",
height: 400,
width:1500,
colNames:['JENISBCDOC', 'NOMORBC', 'TANGGALBC', 'DONO', 'RECEIPTDATE', 'SUPPLIERNAME',
'ITEMCODE', 'ITEMNAME', 'UOM', 'QTY'],
colModel:[
{name:'JENISBCDOC',index:'JENISBCDOC', sorttype:"int", width: 30, frozen : true,key : true},
{name:'NOMORBC',index:'NOMORBC', width:70, frozen : true},
{name:'TANGGALBC',index:'TANGGALBC', width:100, frozen : true},
{name:'DONO',index:'DONO', width:50, align: 'center'},
{name:'RECEIPTDATE',index:'RECEIPTDATE', width:50, width:70, align: 'right'},
{name:'SUPPLIERNAME',index:'SUPPLIERNAME', width:70, align: 'right'},
{name:'ITEMCODE',index:'ITEMCODE', width:70, align: 'right'},
{name:'ITEMNAME',index:'ITEMNAME', width:70, align: 'right'},
{name:'UOM',index:'UOM', width:70, align: 'right'},
{name:'QTY',index:'QTY', width:70, align: 'right', formatter: 'number', formatoptions: {thousandsSeparator: ",",decimalSeparator:".",decimalPlaces: 2}}
],
rowNum:15,
rowList:[15,30,45],
pager: '#p_lapbarangperdoc',
sortname: 'NOURUT',
loadonce :true,
viewrecords: true,
rownumbers : false,
ignoreCase: false,
shrinkToFit :true,
sortorder: "desc",
caption: "Report Penerimaan Barang",
height: 'auto'
});
No comments:
Post a Comment