<script>
$("#dosen").jqGrid({
url:'riset/anggota.php',
postData:{'cari':'false'},
datatype: 'xml',
mtype: 'GET',
height: 100,
width: 380,
headertitles:false,
hiddengrid:false,
altRows:true,
colNames:['NIP','NAMA'],
colModel :[
{name:'nip', index:'nip', width:100,editable:false,key:true},
{name:'nama', width:280,editable:true,search:true,editoptions:{size:"60"},editrules:{required:true}}
],
rowNum:5,
rowList:[5,10,15],
sortname: 'nip',
sortorder: 'asc',
viewrecords: true,
caption: 'Pemeriksa IPB',
editurl:"someurl.php",
toolbar: [true,"top"],
ondblClickRow:fillPemeriksa
});
$("#t_dosen").append("NIP / NAMA : <input name='txtCari' id='txtCari' type='text' size='40'/><input name='butFind' type='button' id='butFind' value='Find' />"); url:'riset/anggota.php',
postData:{'cari':'false'},
datatype: 'xml',
mtype: 'GET',
height: 100,
width: 380,
headertitles:false,
hiddengrid:false,
altRows:true,
colNames:['NIP','NAMA'],
colModel :[
{name:'nip', index:'nip', width:100,editable:false,key:true},
{name:'nama', width:280,editable:true,search:true,editoptions:{size:"60"},editrules:{required:true}}
],
rowNum:5,
rowList:[5,10,15],
sortname: 'nip',
sortorder: 'asc',
viewrecords: true,
caption: 'Pemeriksa IPB',
editurl:"someurl.php",
toolbar: [true,"top"],
ondblClickRow:fillPemeriksa
});
$("#txtCari","#t_dosen").keypress(function(e){
if (e.keyCode==13)
{
$("#dosen").jqGrid('setPostData',{cari:$("#txtCari").val()});
$("#dosen").trigger('reloadGrid');
}
});
$("#butFind","#t_dosen").click(function(){
$("#dosen").jqGrid('setPostData',{cari:$("#txtCari").val()});
$("#dosen").trigger('reloadGrid');
});
/* */
</script>
<table id="dosen"></table>
Tidak ada komentar:
Posting Komentar