日期:2014-05-16  浏览次数:20484 次

easyui datagrid 修改后的数据怎么保存到数据库?
环境:vs2010+mvc4+ef4.0+easyui

 //---------------
        var editIndex = undefined;
        function endEditing() {
            if (editIndex == undefined) { return true }
            if ($('#flexigridData').datagrid('validateRow', editIndex)) {
                var ed = $('#flexigridData').datagrid('getEditor', { index: editIndex, field: 'Id' });
//                var productname = $(ed.target).combobox('getText');
//                $('#flexigridData').datagrid('getRows')[editIndex]['CodeName'] = productname;
                $('#flexigridData').datagrid('endEdit', editIndex);
                editIndex = undefined;
                return true;
            } else {
                return false;
            }
        }
        //----单击ROW-----
        function onClickRow(index) {
            if (editIndex != index) {
                if (endEditing()) {
                    $('#flexigridData').datagrid('selectRow', index)
.datagrid('beginEdit', index);
                    editIndex = index;
                } else {
                    $('#flexigridData').datagrid('selectRow', editIndex);
                }
            }
        }

        //----保存按键------
        function accept() {
            if (endEditing()) {
                $('#flexigridData').datagrid('endEdit', editIndex);
            }
        }


//----后台------
请问点“保存”后怎么把数据更新到数据库呀
---