Hi,
I want to copy - during row editing - a date from one column to another (and maybe change date during copy as required).
With documentation I got to add a button in the datebox field and also an additional button in bottom of the datebox calendar.
See screenshot attached.
Just I cannot get, that on pressing one of these to
set the actual date or anything else to the next datebox column... please for help!
Calculating 2 columns example did not help as I want the copy to happen on a button click and not on onChange.
https://www.jeasyui.com/tutorial/datagrid/datagrid15.phpThanks and BR Michael!
what I tried...
{field:'client_date',title:'Termin Kunde',width:150,align:'center',...
{field:'ops_date',title:'Planung OPS',width:120,align:'center',...
// ---------------------------------------------------------------------------------
// not working code in handler for icon-ok
// ---------------------------------------------------------------------------------
buttons: datebox_buttons,
required:false,
formatter: myformatter,
parser: myparser,
currentText: 'Heute',
closeText: 'Schließen',
icons:[
{
iconCls:'icon-ok',
handler: function(e)
{
var ed = ddv.datagrid('getEditor', {index:editIndex,field:'client_date'});
var val = ed.target.datebox('getValue','');
alert(val);
var ed = ddv.datagrid('getEditor', {index:editIndex,field:'ops_date'});
// not working
( $(ed.target).data('textbox') ? $(ed.target).textbox('textbox') : $(ed.target) ).datebox('setValue',val);
}
},
{
iconCls:'icon-clear',
handler: function(e)
{
// SET FOCUS ON 'OWN' COLUMN WORKS....
var ed = ddv.datagrid('getEditor', {index:editIndex,field:'client_date'});
ed.target.datebox('setValue','');
ed.target.datebox('setText','');
( $(ed.target).data('textbox') ? $(ed.target).textbox('textbox') : $(ed.target) ).select();
( $(ed.target).data('textbox') ? $(ed.target).textbox('textbox') : $(ed.target) ).focus();
}
}
]
// ---------------------------------------------------------------------------------
// not working code in datebox_buttons
// ---------------------------------------------------------------------------------
var datebox_buttons = $.extend([], $.fn.datebox.defaults.buttons);
datebox_buttons.splice(1, 0, {
text: 'CONFIRM',
handler: function(target)
{
alert('click MyBtn');
var ed = $(this).datagrid('getEditor', {index:editIndex,field:'ciient_date'});
var val = ed.target.datebox('setValue','');
alert( val );
var ed = SubDG.datagrid('getEditor', {index:editIndex,field:'ops_date'});
ed.target.datebox('setValue',val);
ed.target.datebox('setText',val);
( $(ed.target).data('textbox') ? $(ed.target).textbox('textbox') : $(ed.target) ).select();
( $(ed.target).data('textbox') ? $(ed.target).textbox('textbox') : $(ed.target) ).focus();
}
});