fastui 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ODlmNTA0NDIxYmY1N2I4NjQyMTM0MmY0MmNmNzlhZDRkOTM1NGEwYw==
4
+ YmUzNDQwZjI2M2FmOWI2MzFjY2E4Y2IxOGY5NWFkMDIxYTNiYzM0Nw==
5
5
  data.tar.gz: !binary |-
6
- MTNkMWVlNTcxZjA4YjcyOGQ1Nzc4ZDE3ODg1NDQwMzcyNmIzMTdiZA==
6
+ ZDdmNGJlYzE1YzAyZjIwMTRhZmI3OWE4YmM3MzU4MWFkZmQ5ZDRlNQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ZGZmMzYxZmYzZDAyY2EwMWQwYWEwYzdjMzAzY2NhYWVhMDNiY2RmZWQxZGU3
10
- ODNkZDE3NzNmZjJjYWM4ODRlMGNlY2EwNzUyMzNiMWVjNWUwZTA3NGZmNzEx
11
- MDU2YWVkNTQzOTczMWE2NzVkMjZjODE4NmIxNDA1MDRmMDJiZTQ=
9
+ YzM4OWQ4NTIzNGRkNmUwM2RiNTRiMTBiNTBmNmRmY2ViYzAwODk5ZjY4MmEx
10
+ ZDdiZDI1ZDE4ZmVmM2IwNTJlYzUyYTdiZDE3NzQ3NDQyZjE1ODJiMTdhMDY0
11
+ ZmJhODgwNGU0YmFmOTQ3ZWY0OWIzMDM1ZGIyNDZjMmY1OTMwOGM=
12
12
  data.tar.gz: !binary |-
13
- NTYwNmU2MTcwMzVjMDQwOTNjMzcyZjhkZTkyMjM0MGJlNDc3NzFiMWVmNTRk
14
- OGViNGI1NWZlMGEyMzFhMDY2MDY1NmQxM2ZhOWIxNGYzNmU1NDNhZGZhMjkw
15
- ZjMyMDE3ZmUyYWFiZDU0OTkxMDgwMDRiNjc1MmFhZWI4MGIxNDI=
13
+ OTBjMTFkY2MxOWRiY2VmODExNmFkYzk1ZTE0YWZlOGFjN2Y3NDU2M2YyY2Mz
14
+ YWU4NTU1NGM3MTUzNWI3NzEzMDUwZDZlNWQxMTM0NjZiODdhZDdkNzYzYzdm
15
+ MDk0MTBmODBhM2M1N2Q1ZGM2ZjViZjEyZmFhZjc4YzkxMjdjNTE=
data/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # FastUI
2
2
 
3
- FastUI is a framework for creating enterprise-level application style interfaces.
4
- This project rocks and uses MIT-LICENSE.
3
+ FastUI is a Ajax Ruby framework for Rapid Development enterprise-level Web application style interfaces.
4
+ In Fastui you only have to write the domain classes in plain Ruby to get a web application ready for production.
5
5
 
6
- Fastui generates a user interface from the model.
6
+ This project rocks and uses MIT-LICENSE.
7
7
 
8
8
  ## Configuration
9
9
 
@@ -5,7 +5,7 @@ Ext.define('FastUI.view.FormFactory', {
5
5
  if (form_kind == '') {
6
6
  return Ext.create('FastUI.view.VForm', {tab: tab});
7
7
  } else {
8
- return Ext.create('FastUI.view.' + this.form_kind, {tab: tab});
8
+ return Ext.create('FastUI.view.' + form_kind, {tab: tab});
9
9
  }
10
10
  }
11
11
  });
@@ -1,34 +1,62 @@
1
1
  Ext.define('FastUI.view.VCustomForm', {
2
- extend:'Ext.form.Panel',
3
- requires: ['FastUI.view.vfield.VFieldFactory'],
2
+ extend:'Ext.Panel',
4
3
  tab:{},
5
- title:'Simple Form',
4
+ url: 'fastui',
5
+ method: 'POST',
6
+ autoEl: {tag: 'form'},
7
+ title:'Custom Form',
6
8
  bodyPadding:5,
7
9
  layout:'anchor',
8
- fieldDefaults: {
9
- labelAlign: 'left',
10
- labelWidth: 90,
11
- anchor: '60%'
12
- },
13
- defaultType:'textfield',
14
- border:true,
10
+ border:false,
11
+ html:'<input name="s11" /> <input name="g22" />',
12
+
15
13
  initComponent:function () {
16
14
  this.title = this.getValue('title');
17
- this.items = this.getFFields();
18
15
  this.callParent();
19
16
  },
20
17
  getValue:function(key){
21
18
  return this.tab.valueObject[key];
22
19
  },
23
20
  getMEntity:function(){
24
- return this.tab.valueObject.m_entity;
21
+ return this.tab.valueObject.entity;
22
+ },
23
+ cmdEdit: function () {
24
+ var id = this.tab.getVGrid().selectedId();
25
+ this.url = this.tab.rest.updatePath(id);
26
+ this.method = 'PUT';
27
+ Ext.Ajax.request({
28
+ url: this.tab.rest.editPath(id),
29
+ success: function (response) {
30
+ var data = Ext.decode(response.responseText);
31
+ this.setValues(data);
32
+ },
33
+ failure: function () {
34
+ Ext.MessageBox.alert("提示", "操作失败!")
35
+ },
36
+ scope: this
37
+ });
25
38
  },
26
- getFFields:function () {
27
- var fields = [];
28
- Ext.each(this.getValue('m_fields'), function (field) {
29
- fields.push(FastUI.view.vfield.VFieldFactory.buildField(field,this.tab.winCtx, this.tab.winId,this.tab.rest));
30
- }, this);
31
- return fields;
39
+ cmdCreate:function(){
40
+ this.url = this.tab.rest.createPath();
41
+ this.method = 'POST';
42
+ this.getEl().dom.reset();
43
+ },
44
+ cmdSave:function(){
45
+ Ext.Ajax.request( {
46
+ url : this.url,
47
+ method : this.method,
48
+ form : this.id,
49
+ success: function () {
50
+ Ext.MessageBox.alert("提示", "操作成功!")
51
+ },
52
+ failure: function () {
53
+ Ext.MessageBox.alert("提示", "操作失败!")
54
+ },
55
+ scope: this
56
+ });
57
+ },
58
+ setValues: function (opt) {
59
+
32
60
  }
33
61
 
34
62
  });
@@ -2,20 +2,20 @@ Ext.define('FastUI.view.VForm', {
2
2
  extend:'Ext.form.Panel',
3
3
  requires: ['FastUI.view.vfield.VFieldFactory'],
4
4
  tab:{},
5
- title:'Simple Form',
6
5
  bodyPadding:5,
7
6
  layout:'anchor',
7
+
8
8
  fieldDefaults: {
9
- labelAlign: 'left',
10
- labelWidth: 90,
11
- anchor: '60%'
9
+ labelAlign: 'right',
10
+ labelWidth: 100,
11
+ //anchor: '60%'
12
+ width: 650
12
13
  },
13
14
  defaultType:'textfield',
14
15
  border:false,
15
16
  initComponent:function () {
16
17
  this.title = this.getValue('title');
17
18
  this.items = this.getFFields();
18
- this.rest = Ext.create('FastUI.view.Rest', this.getMEntity());
19
19
  this.callParent();
20
20
  },
21
21
  getValue:function(key){
@@ -37,7 +37,7 @@ Ext.define('FastUI.view.VForm', {
37
37
  },
38
38
  cmdCreate: function () {
39
39
  var form = this.getForm();
40
- form.url = this.rest.createPath();
40
+ form.url = this.tab.rest.createPath();
41
41
  form.method = 'POST';
42
42
  form.reset();
43
43
  this.setAutoFields(form); // 有数据时要进行测试
@@ -48,7 +48,7 @@ Ext.define('FastUI.view.VForm', {
48
48
  Ext.each(this.getValue('m_fields'), function (mfield) {
49
49
  if (mfield.default_logic && mfield.default_logic.length > 0) {
50
50
  logic = this.winCtx.parseCtx(this.winId, mfield.default_logic);
51
- temp[this.rest.getTableName() + '[' + mfield.m_property.name + ']'] = Ext.decode(logic);
51
+ temp[this.tab.rest.getTableName() + '[' + mfield.m_property.name + ']'] = Ext.decode(logic);
52
52
  }
53
53
  }, this);
54
54
  form.setValues(temp);
@@ -56,13 +56,13 @@ Ext.define('FastUI.view.VForm', {
56
56
  cmdEdit: function () {
57
57
  var id = this.tab.getVGrid().selectedId();
58
58
  var form = this.getForm();
59
- form.url = this.rest.updatePath(id);
59
+ form.url = this.tab.rest.updatePath(id);
60
60
  form.method = 'PUT';
61
61
  this.setEditValues(id, form);
62
62
  },
63
63
  setEditValues: function (id, form) {
64
64
  Ext.Ajax.request({
65
- url: this.rest.editPath(id),
65
+ url: this.tab.rest.editPath(id),
66
66
  success: function (response) {
67
67
  var data = Ext.decode(response.responseText);
68
68
  var k, o = {};
@@ -73,12 +73,12 @@ Ext.define('FastUI.view.VForm', {
73
73
  if (attr && attr.title) {
74
74
  title = attr.title
75
75
  }
76
- o[this.rest.getTableName() + '[' + k + ']'] = {id: data[k], title: title};
76
+ o[this.tab.rest.getTableName() + '[' + k + ']'] = {id: data[k], title: title};
77
77
  } else if (k.match(/_ids$/)) {
78
- o[this.rest.getTableName() + '[' + k + '][]'] = data[k];
78
+ o[this.tab.rest.getTableName() + '[' + k + '][]'] = data[k];
79
79
  }
80
80
  else {
81
- o[this.rest.getTableName() + '[' + k + ']'] = data[k];
81
+ o[this.tab.rest.getTableName() + '[' + k + ']'] = data[k];
82
82
  }
83
83
  }
84
84
  // alert(Ext.encode(o));
@@ -79,94 +79,138 @@ Ext.define('FastUI.view.VGrid', {
79
79
  getMColumns: function () {
80
80
  return this.tab.valueObject.members || [];
81
81
  },
82
- getGFields: function () {
83
- var fields = [];
84
- Ext.each(this.getMColumns(), function (column) {
85
- fields.push({
86
- name: column.name,
87
- type: 'auto'
88
- });
82
+ buildField:function(fields, field){
83
+ field.datatype = field.datatype || '';
84
+ switch (field.datatype) {
85
+ case 'VLookup':
86
+ fields.push({
87
+ name: field.name.replace('_id', ''),
88
+ type: 'auto'
89
+ });
90
+ break;
89
91
 
90
- switch (column.datatype) {
91
- case 'VLookup':
92
- fields.push({
93
- name: column.name.replace('_id', ''),
94
- type: 'auto'
95
- });
96
- break;
92
+ case 'VSingleChoice':
93
+ fields.push({
94
+ name: field.name.replace('_id', ''),
95
+ type: 'auto'
96
+ });
97
+ break;
98
+
99
+ case 'VGroup':
100
+ Ext.each(field.members, function(member){
101
+ this.buildField(fields,member);
102
+ },this);
103
+ break;
97
104
 
98
- case 'VSingleChoice':
105
+ default:
106
+ if(Array.isArray(field)){
107
+ Ext.each(field, function(f){
108
+ this.buildField(fields,f);
109
+ },this);
110
+ }else{
99
111
  fields.push({
100
- name: column.name.replace('_id', '').pluralize(),
112
+ name: field.name,
101
113
  type: 'auto'
102
114
  });
103
- break;
104
-
105
- default:
106
- break;
107
- }
115
+ }
116
+ }
117
+ },
118
+ getGFields: function () {
119
+ var fields = [];
120
+ Ext.each(this.getMColumns(), function (column) {
121
+ this.buildField(fields, column);
108
122
  }, this);
109
123
  return fields;
110
124
  },
111
- getGColumns: function () {
112
- var columns = [];
113
- Ext.each(this.getMColumns(), function (column) {
114
- column.display = column.display || 'all';
115
- if (column.display == 'all' || column.display == 'grid') {
116
- var col = {
125
+ buildColumn: function(columns, column){
126
+ column.datatype = column.datatype || '';
127
+ switch (column.datatype) {
128
+ case 'VLookup':
129
+ var entity = column.name.replace('_id', '');
130
+ columns.push({
117
131
  text: column.title,
118
- dataIndex: column.name
119
- //width: column.column_width || 75
120
- //xtype:''
121
- };
132
+ dataIndex: column.name,
133
+ display: column.display || 'all',
134
+ xtype: 'templatecolumn',
135
+ tpl: new Ext.XTemplate('<tpl for="' + entity + '">', '{title}', '</tpl>')
136
+ });
137
+ break;
122
138
 
123
- switch (column.datatype) {
124
- case 'VLookup':
125
- col.xtype = 'templatecolumn';
126
- var entity = column.name.replace('_id', '');
127
- col.tpl = new Ext.XTemplate(
128
- '<tpl for="' + entity + '">',
129
- '{title}',
130
- '</tpl>'
131
- );
132
- break;
133
- case 'MultipleChoice':
134
- col.xtype = 'templatecolumn';
135
- var plur_entity = column.name.replace('_ids', '').pluralize();
136
- col.tpl = new Ext.XTemplate(
137
- '<tpl for="' + plur_entity + '">',
138
- '{title}',
139
- '</tpl>'
140
- );
141
- break;
142
- case 'VSingleChoice':
139
+ case 'MultipleChoice':
140
+ var plur_entity = column.name.replace('_ids', '').pluralize();
141
+ columns.push({
142
+ text: column.title,
143
+ dataIndex: column.name,
144
+ display: column.display || 'all',
145
+ xtype: 'templatecolumn',
146
+ tpl: new Ext.XTemplate('<tpl for="' + plur_entity + '">', '{title}', '</tpl>')
147
+ });
148
+ break;
149
+
150
+ case 'VSingleChoice':
151
+ columns.push({
152
+ text: column.title,
153
+ dataIndex: column.name,
154
+ display: column.display || 'all',
155
+ renderer: function(val) {
143
156
  var list_store = FastUI.store.MListMgr.getStore(column.name);
144
- col.renderer = function (val) {
145
- var index = list_store.findExact('name', val);
146
- if (index > -1) {
147
- var rs = list_store.getAt(index).data;
148
- return rs.title;
149
- }
150
- return "";
151
- };
152
- break;
153
- case 'VSexSelect':
154
- col.renderer = function (val) {
155
- return val ? '男' : '女'
156
- };
157
- break;
158
- case 'VYesOrNo':
159
- col.renderer = function (val) {
160
- return val ? '' : '';
161
- };
162
- break;
163
- default:
164
- break;
157
+ var index = list_store.findExact('name', val);
158
+ if (index > -1) {
159
+ var rs = list_store.getAt(index).data;
160
+ return rs.title;
161
+ }
162
+ return "";
163
+ }
164
+ });
165
+ break;
166
+
167
+ case 'VSexSelect':
168
+ columns.push({
169
+ text: column.title,
170
+ dataIndex: column.name,
171
+ display: column.display || 'all',
172
+ renderer: function (val) {
173
+ return val ? '' : ''
174
+ }
175
+ });
176
+ break;
177
+
178
+ case 'VYesOrNo':
179
+ columns.push({
180
+ text: column.title,
181
+ dataIndex: column.name,
182
+ display: column.display || 'all',
183
+ renderer: function (val) {
184
+ return val ? '是' : '否';
185
+ }
186
+ });
187
+ break;
188
+
189
+ case 'VGroup':
190
+ Ext.each(column.members, function (member) {
191
+ this.buildColumn(columns, member);
192
+ },this);
193
+ break;
194
+
195
+ default:
196
+ if(Array.isArray(column)){
197
+ Ext.each(column, function(c){
198
+ this.buildColumn(columns, c);
199
+ },this);
200
+ }else{
201
+ columns.push({
202
+ text: column.title,
203
+ dataIndex: column.name,
204
+ display: column.display || 'all'
205
+ });
165
206
  }
166
- columns.push(col);
167
- }
207
+ }
208
+ },
209
+ getGColumns: function () {
210
+ var columns = [];
211
+ Ext.each(this.getMColumns(), function (column) {
212
+ this.buildColumn(columns,column);
168
213
  }, this);
169
-
170
214
  return columns;
171
215
  }
172
216
  });
@@ -157,7 +157,7 @@ Ext.define('FastUI.view.VTab', {
157
157
  this.vform = FastUI.view.FormFactory.createForm(this.form_kind, this);
158
158
  this.add(this.vform);
159
159
  }
160
- return this.vform.getForm();
160
+ return this.vform;
161
161
  // if (this.form_kind == '') {
162
162
  // if (!this.vform) {
163
163
  // this.vform = Ext.create('FastUI.view.VForm', {tab: this});
@@ -1,19 +1,20 @@
1
- Ext.define('FastUI.view.vfield.VCheckBox',{
2
- extend: 'Ext.form.field.CheckBox',
3
-
1
+ Ext.define('FastUI.view.vfield.VBool',{
2
+ extend: 'Ext.form.field.Checkbox',
4
3
  valueObject: {},
5
4
  winCtx:{},
6
5
  winId:0,
7
6
  rest:{},
8
7
 
8
+ inputValue: 'true',
9
+ uncheckedValue: 'false',
9
10
  initComponent:function(){
10
11
  this.fieldLabel = this.getFValue('title');
11
- this.name = this.rest.getTableName() + '[' + this.getFValue('m_property').name + ']';
12
- this.disabled = this.getFValue('is_readonly');
12
+ this.name = this.rest.getTableName() + '[' + this.getFValue('name') + ']';
13
+ this.disabled = this.getFValue('readonly');
13
14
  this.allowBlank = true;
14
15
  this.callParent();
15
16
  },
16
17
  getFValue:function (key) {
17
- return this.valueObject[key];
18
+ return this.valueObject[key] || '';
18
19
  }
19
20
  });
@@ -22,56 +22,87 @@ Ext.define('FastUI.view.vfield.VFieldFactory', {
22
22
  },
23
23
 
24
24
  buildField: function (field, winCtx, winId, rest) {
25
- var dt = field.datatype;
25
+ field.datatype = field.datatype || '';
26
26
  switch (field.datatype) {
27
27
  case 'VText':
28
28
  return Ext.create('FastUI.view.vfield.VText', {valueObject: field, winCtx: winCtx, winId: winId, rest: rest});
29
- break;
29
+
30
30
  case 'VTree':
31
31
  return Ext.create('FastUI.view.vfield.VTree', {valueObject: field, winCtx: winCtx, winId: winId, rest: rest});
32
- break;
32
+
33
33
  case 'VDate':
34
34
  return Ext.create('FastUI.view.vfield.VDate', {valueObject: field, winCtx: winCtx, winId: winId, rest: rest});
35
- break;
35
+
36
36
  case 'VHtmlEditor':
37
37
  return Ext.create('FastUI.view.vfield.VHtmlEditor', {valueObject: field, winCtx: winCtx, winId: winId, rest: rest});
38
- break;
38
+
39
39
  case 'VSingleChoice':
40
40
  return Ext.create('FastUI.view.vfield.VSingleChoice', {valueObject: field, winCtx: winCtx, winId: winId, rest: rest});
41
- break;
41
+
42
42
  case 'VMultipleChoice':
43
43
  return Ext.create('FastUI.view.vfield.VMultipleChoice', {valueObject: field, winCtx: winCtx, winId: winId, rest: rest});
44
- break;
45
- case this.VType.VLongCombobox:
46
- return Ext.create('FastUI.view.vfield.VLongCombobox', {valueObject: field, winCtx: winCtx, winId: winId, rest: rest});
47
- break;
44
+
45
+ case 'VRadio':
46
+ return Ext.create('FastUI.view.vfield.VRadio', {valueObject: field, winCtx: winCtx, winId: winId, rest: rest});
47
+
48
48
  case 'VTextArea':
49
49
  return Ext.create('FastUI.view.vfield.VTextArea', {valueObject: field, winCtx: winCtx, winId: winId, rest: rest});
50
- break;
50
+
51
51
  case 'VNumber':
52
52
  return Ext.create('FastUI.view.vfield.VNumber', {valueObject: field, winCtx: winCtx, winId: winId, rest: rest});
53
- break;
53
+
54
+ case 'VBool':
55
+ return Ext.create('FastUI.view.vfield.VBool', {valueObject: field, winCtx: winCtx, winId: winId, rest: rest});
56
+
54
57
  case 'VCheckbox':
55
58
  return Ext.create('FastUI.view.vfield.VCheckbox', {valueObject: field, winCtx: winCtx, winId: winId, rest: rest});
56
- break;
57
- case 'VCheckboxGroup':
58
- return Ext.create('FastUI.view.vfield.VCheckboxGroup', {valueObject: field, winCtx: winCtx, winId: winId, rest: rest});
59
- break;
59
+
60
60
  case 'VSexSelect':
61
61
  return Ext.create('FastUI.view.vfield.VSexSelect', {valueObject: field, winCtx: winCtx, winId: winId, rest: rest});
62
- break;
62
+
63
63
  case 'VFile':
64
64
  return Ext.create('FastUI.view.vfield.VFile', {valueObject: field, winCtx: winCtx, winId: winId, rest: rest});
65
- break;
65
+
66
66
  case 'VYesOrNo':
67
67
  return Ext.create('FastUI.view.vfield.VYesOrNo', {valueObject: field, winCtx: winCtx, winId: winId, rest: rest});
68
- break;
68
+
69
69
  case 'VList':
70
70
  return Ext.create('FastUI.view.vfield.VCombobox', {valueObject: field, winCtx: winCtx, winId: winId, rest: rest});
71
- break;
71
+
72
72
  case 'VLookup':
73
73
  return Ext.create('FastUI.view.vfield.VLookup', {valueObject: field, winCtx: winCtx, winId: winId, rest: rest});
74
- break;
74
+
75
+ case 'VGroup':
76
+ var box = Ext.create('Ext.form.FieldSet',{
77
+ title: field.title,
78
+ collapsible: true,
79
+ defaults: {
80
+ labelWidth: 89,
81
+ layout: {
82
+ type: 'hbox',
83
+ defaultMargins: {top: 0, right: 0, bottom: 5, left: 0}
84
+ }
85
+ },
86
+ defaultType: 'textfield'
87
+ });
88
+ Ext.each(field.members, function(member){
89
+ box.add(this.buildField(member, winCtx, winId, rest));
90
+ },this);
91
+ return box;
92
+
93
+ default:
94
+ if(Array.isArray(field)){
95
+ var line = Ext.create('Ext.container.Container', {
96
+ layout: 'hbox',
97
+ margin: '0 0 5 0',
98
+ defaultType: 'textfield'
99
+ });
100
+ Ext.each(field, function(f){
101
+ line.add(this.buildField(f, winCtx, winId, rest));
102
+ },this);
103
+ return line;
104
+ }
105
+
75
106
  }
76
107
  }
77
108
  });
@@ -5,11 +5,12 @@ Ext.define('FastUI.view.vfield.VHtmlEditor',{
5
5
  winCtx:{},
6
6
  winId:0,
7
7
  rest:{},
8
+ width:650,
8
9
 
9
10
  initComponent:function(){
10
11
  this.fieldLabel = this.getFValue('title');
11
- this.name = this.rest.getTableName() + '[' + this.getFValue('m_property').name + ']';
12
- this.disabled = this.getFValue('is_readonly');
12
+ this.name = this.rest.getTableName() + '[' + this.getFValue('name') + ']';
13
+ this.disabled = this.getFValue('readonly');
13
14
  this.allowBlank = true;
14
15
  this.callParent();
15
16
  },
@@ -6,6 +6,7 @@ Ext.define('FastUI.view.vfield.VLookup', {
6
6
  winId:0,
7
7
  rest:{},
8
8
 
9
+ triggerCls: Ext.baseCSSPrefix + 'form-search-trigger',
9
10
  editable:false,
10
11
  displayField:'title',
11
12
  valueField:'id',
@@ -0,0 +1,34 @@
1
+ Ext.define('FastUI.view.vfield.VRadio',{
2
+ extend: 'Ext.form.RadioGroup',
3
+ valueObject: {},
4
+ winCtx:{},
5
+ winId:0,
6
+ rest:{},
7
+ width:300,
8
+
9
+ initComponent:function(){
10
+ this.fieldLabel = this.getFValue('title');
11
+ this.disabled = this.getFValue('readonly');
12
+ this.allowBlank = true;
13
+ this.items = this.getFFields();
14
+ this.callParent();
15
+ },
16
+ getFValue:function (key) {
17
+ return this.valueObject[key] || '';
18
+ },
19
+ getFFields:function(){
20
+ var fields = [];
21
+ var store = FastUI.store.MListMgr.getStore(this.getFValue('name'));
22
+ store.each(function(item, index, count) {
23
+ fields.push({
24
+ name: this.rest.getTableName() + '[' + this.getFValue('name') + ']',
25
+ boxLabel: item.data.title,
26
+ inputValue: item.data.name,
27
+ width:100
28
+ });
29
+ },this);
30
+ return fields;
31
+ }
32
+
33
+ });
34
+
@@ -1,27 +1,20 @@
1
1
  Ext.define('FastUI.view.vfield.VSexSelect',{
2
- extend: 'Ext.form.field.ComboBox',
2
+ extend: 'Ext.form.RadioGroup',
3
3
  valueObject: {},
4
4
  winCtx:{},
5
5
  winId:0,
6
6
  rest:{},
7
7
 
8
- valueField:"sex_bool",
9
- displayField:"name",
10
- forceSelection: true,
11
- triggerAction: 'all',
12
- selectOnFocus:true,
13
- queryMode:"local",
14
- hiddenName:this.name,
8
+ width:300,
15
9
 
16
10
  initComponent:function(){
17
11
  this.fieldLabel = this.getFValue('title');
18
- this.name = this.rest.getTableName() + '[' + this.getFValue('m_property').name + ']';
19
12
  this.disabled = this.getFValue('readonly');
20
13
  this.allowBlank = true;
21
- this.store = Ext.create('Ext.data.ArrayStore',{
22
- fields: ["name","sex_bool"],
23
- data:[['',true],['',false]]
24
- });
14
+ this.items = [
15
+ { boxLabel: '男', name: this.rest.getTableName() + '[' + this.getFValue('name') + ']', inputValue: 'true', width:100 },
16
+ { boxLabel: '女', name: this.rest.getTableName() + '[' + this.getFValue('name') + ']', inputValue: 'false', width:100 }
17
+ ];
25
18
  this.callParent();
26
19
  },
27
20
  getFValue:function (key) {
@@ -0,0 +1,7 @@
1
+ Ext.apply(Ext.form.field.VTypes,{
2
+ uniquename: function (v) {
3
+ return Ext.form.field.VTypes.uniquenameRegex.test(v);
4
+ },
5
+ uniquenameRegex: /^[a-z]{1}[a-z_0-9]*$/,
6
+ uniquenameText: 'Invalid unique name'
7
+ });
@@ -92,4 +92,3 @@
92
92
  .fastui-btn-help {
93
93
  background-image: url( table/help.png ) !important;
94
94
  }
95
-
@@ -1,3 +1,3 @@
1
1
  module Fastui
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - sgzhe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-03 00:00:00.000000000 Z
11
+ date: 2013-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -159,8 +159,7 @@ files:
159
159
  - app/assets/javascripts/fastui/app/view/VCriteria.js
160
160
  - app/assets/javascripts/fastui/app/view/VCustomForm.js
161
161
  - app/assets/javascripts/fastui/app/view/VCustomTab.js
162
- - app/assets/javascripts/fastui/app/view/vfield/VCheckBox.js
163
- - app/assets/javascripts/fastui/app/view/vfield/VCheckboxGroup.js
162
+ - app/assets/javascripts/fastui/app/view/vfield/VBool.js
164
163
  - app/assets/javascripts/fastui/app/view/vfield/VDate.js
165
164
  - app/assets/javascripts/fastui/app/view/vfield/VFieldFactory.js
166
165
  - app/assets/javascripts/fastui/app/view/vfield/VFile.js
@@ -169,11 +168,13 @@ files:
169
168
  - app/assets/javascripts/fastui/app/view/vfield/VLookup.js
170
169
  - app/assets/javascripts/fastui/app/view/vfield/VMultipleChoice.js
171
170
  - app/assets/javascripts/fastui/app/view/vfield/VNumber.js
171
+ - app/assets/javascripts/fastui/app/view/vfield/VRadio.js
172
172
  - app/assets/javascripts/fastui/app/view/vfield/VSexSelect.js
173
173
  - app/assets/javascripts/fastui/app/view/vfield/VSingleChoice.js
174
174
  - app/assets/javascripts/fastui/app/view/vfield/VText.js
175
175
  - app/assets/javascripts/fastui/app/view/vfield/VTextArea.js
176
176
  - app/assets/javascripts/fastui/app/view/vfield/VTree.js
177
+ - app/assets/javascripts/fastui/app/view/vfield/VType.js
177
178
  - app/assets/javascripts/fastui/app/view/vfield/VYesOrNo.js
178
179
  - app/assets/javascripts/fastui/app/view/VForm.js
179
180
  - app/assets/javascripts/fastui/app/view/VGrid.js
@@ -1,19 +0,0 @@
1
- Ext.define('FastUI.view.vfield.VCheckboxGroup',{
2
- extend: 'Ext.form.VCheckboxGroup',
3
-
4
- valueObject: {},
5
- winCtx:{},
6
- winId:0,
7
- rest:{},
8
-
9
- initComponent:function(){
10
- this.fieldLabel = this.getFValue('title');
11
- this.name = this.rest.getTableName() + '[' + this.getFValue('m_property').name + ']';
12
- this.disabled = this.getFValue('is_readonly');
13
- this.allowBlank = true;
14
- this.callParent();
15
- },
16
- getFValue:function (key) {
17
- return this.valueObject[key];
18
- }
19
- });