範例說明, 產品欄位選中的產品的單價帶到單價欄位.
產品用InfoRefVal元件,要設定:
onSelect:dataGridDetailProductIdOnSelect
selectOnly:true
function dataGridDetailProductIdOnSelect(selectedRow) {
var unitPrice = selectedRow.UnitPrice;
var editingRowIndex = $('#dataGridDetail').datagrid('getRowIndex', $('#dataGridDetail').datagrid('getSelected'));
var editor = $('#dataGridDetail').datagrid('getEditor', { index: editingRowIndex, field: 'UnitPrice' });
$(editor.target).val(unitPrice);
}