datagrid可以動態的disable和enable欄位嗎?
dataGrid無法通過js來控制readonly,如果是要控制輸入項,您可以參考:

//修改時,欄位不可編輯。寫在DataGrid onUpdate事件
function UpdateTest() {
            var row = $(dgid).datagrid('getSelected');
            var index = $(dgid).datagrid('getRowIndex', row);
            var editIndex = undefined;
            if (editIndex != index) {
                    $(dgid).datagrid('selectRow', index).datagrid('beginEdit', index);
                    var cellEdit = $(dgid).datagrid('getEditor', { index: index, field: 'FieldName' });
                    
                       $(cellEdit.target).attr("disabled", "disabled"); //text
                       //$(cellEdit.target).combobox('disable'); //combobox
                       //$(cellEdit.target).datebox({ disabled: true }); //datebox
                       //$(cellEdit.target).refval('disable'); //refval
            }            
        }
 
//新增時,欄位不可編輯。在DataGrid toolItem新增一個按鈕
function InsertTest() {            
            var index = $(dgid).datagrid('getRows').length;
            insertItem(dgid, "$(this)"); //--新增空白一筆記錄
            var editIndex = undefined;
            if (editIndex != index) {
                $(dgid).datagrid('selectRow', index).datagrid('beginEdit', index);
                var cellEdit = $(dgid).datagrid('getEditor', { index: index, field: 'FieldName' });;
 
                $(cellEdit.target).attr("disabled", "disabled"); //text
                //$(cellEdit.target).combobox('disable'); //combobox
                //$(cellEdit.target).datebox({ disabled: true }); //datebox
                //$(cellEdit.target).refval('disable'); //refval
            }
}