iskandarkbr
|
 |
« on: March 08, 2015, 07:19:33 PM » |
|
i've tried your code in http://jsfiddle.net/2UXEM/2/but it still doesnot work what i plan is when i press enter on editor it focus on next field's editor P.S. i am using your cellediting
|
|
|
Logged
|
|
|
|
|
iskandarkbr
|
 |
« Reply #2 on: March 08, 2015, 08:52:04 PM » |
|
actually i cant find onEdit event on datagrid. its only on edatagrid.
Why focus() method doesnt work on datagrid (not edatagrid), i try cell editing on datagrid
|
|
« Last Edit: March 08, 2015, 08:59:07 PM by iskandarkbr »
|
Logged
|
|
|
|
iskandarkbr
|
 |
« Reply #3 on: March 08, 2015, 09:22:35 PM » |
|
function onClickCell(index, field){ if (endEditing()){ //console.log(endEditing()); $('#dg').datagrid('selectRow', index) .datagrid('editCell', {index:index,field:field}); editIndex = index; } var editor = $('#dg').datagrid('getEditor', {index:index,field:field}); editor.target.focus() }
as you see above, i tried to modify your example, but the focus() dosnt work, it doesnt focus anywhere.
|
|
|
Logged
|
|
|
|
|
iskandarkbr
|
 |
« Reply #5 on: March 09, 2015, 02:39:38 AM » |
|
var ed1 = $(this).datagrid('getEditor',{index:index,field:'idtemuan'}); var ed2 = $(this).datagrid('getEditor',{index:index,field:'listprice'}); var ed3 = $(this).datagrid('getEditor',{index:index,field:'unitcost'}); setKeydown([ed1.target,ed2.target,ed3.target]);
it return
TypeError: ed2 is null
setKeydown([ed1.target,ed2.target,ed3.target]);
|
|
|
Logged
|
|
|
|
iskandarkbr
|
 |
« Reply #6 on: March 09, 2015, 09:04:18 PM » |
|
i try this code :
onClickRow:function(rowIndex){ var editors=$(this).datagrid("getEditors",rowIndex); $(editors[0].target).combo('textbox').bind('keydown',function(e){ if(editors[0].field=='idtemuan'){ if(e.which==39){ console.log(editors[0].field); $(this).datagrid('selectRow', rowIndex); $(this).datagrid('editCell', {index: rowIndex,field: 'lisprice'}); } }else if(editors[0].field=='listprice'){ if(e.which==13){ console.log(editors[0].field); } }else if(editors[0].field=='unitcost'){ if(e.which==13||e.which==9){ console.log(editors[0].field); } } });
but it doesnot works, it said :
TypeError: $.data(...) is undefined var opts=$.data(_675,"datagrid").options;
|
|
|
Logged
|
|
|
|
iskandarkbr
|
 |
« Reply #7 on: March 09, 2015, 11:29:23 PM » |
|
great!!!..i found
i just replaced $(this)" by $("#datagridname")...thanks stworthy
|
|
|
Logged
|
|
|
|
|