struts2 - jqgrid with datepicker not show? -
implement datepicker jqgrid , not list when add editoptions.
//javascript
function datepick (elem) { alert("hellow 1"); jquery(elem).datepicker( // {} // options here $(elem).datepicker({dateformat:'yy.mm.dd'}) ); } function dateval(){ var currenttime = new date(); var month = parseint(currenttime.getmonth() + 1); month = month <= 9 ? "0"+month : month; var day = currenttime.getdate(); day = day <= 9 ? "0"+day : day; var year = currenttime.getfullyear(); return year+"-"+month + "-"+day; }
//jqgrid
<sjg:gridcolumn name="id" index="id" title="id"/><sjg:gridcolumn name="nombre" index="nombre" title="name" sortable="true" search="true" editable="true"/> <sjg:gridcolumn name="fecha" index="fecha" title="fecha" editable="true" formatter="date" edittype="text" editoptions="{datainit:function(el){ $(el).datepicker({dateformat:'yy-mm-dd'});},defaultvalue:dateval}"/> </sjg:grid>
///////update <3 solution in "loadatonce".
Comments
Post a Comment