Datagrid
<script type='text/javascript'>
$(function() {
var datanya = <?php echo json_encode($_POST); ?>;
var type = '<?=$TANDA; ?>';
$("#result").datagrid({
//url : $.post('<?= site_url() ?>/tiket/searchResult/',datanya,'success'),
url : '<?= site_url() ?>/masterp/searchResult/type/'+type,
method : 'POST',
queryParams: datanya,
columns:[[
{field:'Cust_ID',title:'Cust_ID',sortable:true,formatter:formatCustomerId},
{field:'KD_Cust',title:'KD_Cust',sortable:true},
{field:'Nama_Cust',title:'Nama_Cust',sortable:true},
{field:'Alamat',title:'Alamat',sortable:true},
{field:'Telp',title:'Telp',sortable:true},
{field:'CP',title:'CP',sortable:true},
{field:'Nama_CustType',title:'Cust Type',sortable:true},
{field:'IsAktif',title:'IsAktif',sortable:true,formatter:formatPrice}
]],
showHeader:"true",
toolbar:"#toolbard",
pagination:"true",
nowrap: "false",
pageSize: 10,
fitcolumns: "true",
rownumbers: "false",
singleSelect: "true"
})
});
</script>
Buat Format Link :
<script>
function formatCustomerId(val,row){
var url = "customerView.php?id=";
return '<a href="'+url + row.Cust_ID+'">'+val+'</a>';
}
</script>
Tidak ada komentar:
Posting Komentar