Forum


12:54

19/11/2008

hello advance.. can help me i have some problem with datepicker.
i use a jQuery UI Date Picker v3.0
in row edit i cant showing datepicker may be advance can help my problem this my code...
url:'selectkontrakkerja.php?q=1&rows=10',
datatype: "xml",
colNames:['ID Kontrak Kerja','No Proposal','Tgl Kontrak','Perusahaan','Project','Nilai Penawaran','Nilai Kontrak', 'Pembayaran','Termin'],
colModel:[
{name:'idp',index:'id_kontrakkerja', width:15,align:"center",search:false,editable:true,editoptions:{readonly:true,size:5,align:"center"}},
{name:'no_prop', index:'id_proposal', width:60, align:"left", editable:true, editoptions:{readonly:true,size:5}},
{name:'tgl', index:'tgl_kontrak', width:60, align:"left",editable:true, editopitons:{size:30}},
{name:'nm_per',index:'nm_client', width:90,editable:true,search:true,editoptions:{readonly:true,size:40}},
{name:'proj',index:'nm_project', width:60, align:"left",editable:true,editoptions:{readonly:true,size:40}},
{name:'nl_pen',index:'nilai', width:60, align:"left",editable:true,editoptions:{readonly:true,size:40}},
{name:'nl_kon',index:'nilai_kontrak', width:60, align:"left",editable:true,editoptions:{size:40}},
{name:'pembayaran',index:'pembayaran', width:60, align:"left",editable:true,edittype:"select",editoptions:{value:"1:Cash;2:Termin"}},
{name:'pembayaran',index:'pembayaran', width:60, align:"left",editable:true,edittype:"select",editoptions:{value:"1:30;2:60;3:90"}}
],
rowNum:10,
rowList:[10,20,30],
imgpath: 'themes/basic/images',
pager: jQuery('#pagered'),
sortname: 'id_kontrakkerja',
viewrecords: true,
sortorder: "desc",
width: 750, // new width
height: 220,
caption:"Kontrak Kerja",
editurl:'editkontrakkerja.php'
}).navGrid('#pagered',{edit:true,add:false,del:false});
$("#bedata").click(function(){
var gr = jQuery("#editgrid").getGridParam('selrow');
if( gr != null ) jQuery("#editgrid").editGridRow(gr,{height:280,reloadAfterSubmit:true,
onInitializeForm: $("#tgl_kontrak").datepicker({dateFormat:"dd-mm-yy",showOn:'focus'})
});
else alert("Please Select Row");
});
03:13

Moderators
30/10/2007

Hello,
Your error maybe is that you do not have tgl_kontrak as name,
but as index in the colModel
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
12:01

19/11/2008

Sorry… Advance
Your intention code this:
{name:’tgl’, index:’tgl_kontrak’, width:60, align:â€leftâ€,editable:true, editopitons:{size:30}}
Compared with this:
onInitializeForm: $(â€#tgl_kontrakâ€).datepicker({dateFormat:â€dd-mm-yyâ€,showOn:’focus’})
});
Could you explained and few suggestions from my code above…
thank you Advance…
madkixt
04:03

Moderators
30/10/2007

Hello,
You try to attach a datepicker to nonexisting element.
When the edit form is created the elements have the id taken from
colModel name - so if the name (and not the index - index is used
to perform sorting server side) is tgl then the id in form have the same
value - with other words to work this you should
$(”#tgl”).datepicker({...}) and not $(”#tgl_kontrak”).datepicker({..})
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
11:08

Moderators
30/10/2007

Hello,
onInitializeForm: function(formid) {
$ (”#tgl”,formid) .datepicker ({
dateFormat:”dd-mm-yy”,showOn:’focus’}) ;
}
Regards
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
67 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66