动态控制某些字段可以修改

 1 int       ret, j, i;
 2 DictTable dictTable;
 3 DictField DictField;
 4 str       curFieldName;
 5 ;
 6 dictTable = new DictTable(tableNum(yourTableName));
 7 i = dictTable.fieldCnt()-11;//这里系统会包括表的其他11个父类字段,所以减去11
 8 for (j = 1; j <= i; j++)
 9 {
10     DictField=new DictField(dictTable.id(),dictTable.fieldCnt2Id(j));
11     curFieldName=DictField.name();
12     if (curFieldName!='Fieldname')
13         yourTableName_ds.object(DictField.id()).allowEdit(false);
14     else
15         yourTableName_ds.object(DictField.id()).allowEdit(true);
16 }
posted @ 2012-08-30 11:28  Sprite.z  Views(143)  Comments(0Edit  收藏  举报