In your tutorial give the following sample:
$('#tt').datagrid({
onClickRow:function(rowIndex){
if (lastIndex != rowIndex){
$(this).datagrid('endEdit', lastIndex);
$(this).datagrid('beginEdit', rowIndex);
}
lastIndex = rowIndex;
},
onBeginEdit:function(rowIndex){
var editors = $('#tt').datagrid('getEditors', rowIndex);
var n1 = $(editors[0].target);
var n2 = $(editors[1].target);
var n3 = $(editors[2].target);
n1.add(n2).numberbox({
onChange:function(){
var cost = n1.numberbox('getValue')*n2.numberbox('getValue');
n3.numberbox('setValue',cost);
}
})
}
});
As I understand you walk through the array of all editors within the row an assign them to the names n1,n2,...
If I don't want / need all existing editors for my calculation I would have the risk of corruption of the calculation if the order of fields changes.
Is it possible to address the field-editor by name or similar?