Permalink
Browse files

添加remark字段,首页Done

  • Loading branch information...
xEasy committed Mar 22, 2012
1 parent f718a67 commit 65f9b691b9642517335162fbee622faf66a9ca8b
View
@@ -1,10 +1,11 @@
+# -*- encoding : utf-8 -*-
+
class Student < Person
belongs_to :classes
has_many :course_scores
- def detail
-
+ def grade
+ '优秀'
end
-
end
@@ -0,0 +1,21 @@
+class AddRemarkToAll < ActiveRecord::Migration
+ def self.up
+ add_column :classes, :remark, :string
+ add_column :people, :remark, :string
+ add_column :courses, :remark, :string
+ add_column :score_types, :remark, :string
+ add_column :course_scores, :remark, :string
+ add_column :comments, :remark, :string
+ add_column :comment_types, :remark, :string
+ end
+
+ def self.down
+ remove_column :classes, :remark
+ remove_column :people, :remark
+ remove_column :courses, :remark
+ remove_column :score_types, :remark
+ remove_column :course_scores, :remark
+ remove_column :comments, :remark
+ remove_column :comment_types, :remark
+ end
+end
View
@@ -10,25 +10,28 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20120322065109) do
+ActiveRecord::Schema.define(:version => 20120322072226) do
create_table "classes", :force => true do |t|
t.string "name"
t.datetime "created_at"
t.datetime "updated_at"
+ t.string "remark"
end
create_table "comment_types", :force => true do |t|
t.string "name"
t.datetime "created_at"
t.datetime "updated_at"
+ t.string "remark"
end
create_table "comments", :force => true do |t|
t.string "content"
t.integer "comment_type_id"
t.datetime "created_at"
t.datetime "updated_at"
+ t.string "remark"
end
create_table "course_scores", :force => true do |t|
@@ -38,12 +41,14 @@
t.datetime "created_at"
t.datetime "updated_at"
t.string "grade"
+ t.string "remark"
end
create_table "courses", :force => true do |t|
t.string "name"
t.datetime "created_at"
t.datetime "updated_at"
+ t.string "remark"
end
create_table "people", :force => true do |t|
@@ -61,6 +66,7 @@
t.datetime "image_updated_at"
t.datetime "created_at"
t.datetime "updated_at"
+ t.string "remark"
end
create_table "score_types", :force => true do |t|
@@ -69,6 +75,7 @@
t.integer "end"
t.datetime "created_at"
t.datetime "updated_at"
+ t.string "remark"
end
create_table "users", :force => true do |t|
@@ -33,7 +33,19 @@ Pf.classes.homeIndex.MainPanel = Ext.extend(Ext.Panel, {
var store = new Pf.util.FieldsJsonStore({
root : 'root',
url : '/homes/get_classes_students.json',
- fields : ["id",'name','number','phone','home','remark','sex','classes/name']
+ fields : [
+ "id",
+ 'name',
+ 'number',
+ 'phone',
+ 'home',
+ 'remark' ,
+ 'sex',
+ 'classes/name',
+ 'comment',
+ 'image/url',
+ 'grade'
+ ]
});
var cm = new Ext.grid.ColumnModel({
@@ -89,7 +101,9 @@ Pf.classes.homeIndex.MainPanel = Ext.extend(Ext.Panel, {
var scoreGridStore = Ext.getCmp('score-grid').getStore();
scoreGridStore.load({ params : { s_id : s_id } });
//显示详细
- var form = scope.form.getForm();
+ var form = scope.form.getForm()
+ form.reset();
+ form.loadRecord(record);
//加载头像
//$("#image img").attr("src", record.get('image/url'));
}
@@ -122,6 +136,7 @@ Pf.classes.homeIndex.MainPanel = Ext.extend(Ext.Panel, {
loadMask :true,
cm : cm,
height : 200,
+ sm : new Ext.grid.RowSelectionModel({}),
title : "学生成绩",
stripeRows: true,
viewConfig: { forceFit: true },
@@ -162,7 +177,10 @@ Pf.classes.homeIndex.MainPanel = Ext.extend(Ext.Panel, {
name: 'sex',
}, {
fieldLabel: '班级',
- name: 'classes',
+ name: 'classes/name',
+ }, {
+ fieldLabel: '评级',
+ name: 'grade',
}]
},{
defaults : { anchor : '95%' ,readOnly : true},
@@ -187,7 +205,7 @@ Pf.classes.homeIndex.MainPanel = Ext.extend(Ext.Panel, {
layout : 'fit',
items : [{
xtype: 'textarea',
- id: 'bio',
+ name : 'comment',
height: 150,
readOnly : true,
anchor: '98%'

0 comments on commit 65f9b69

Please sign in to comment.