Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tableTempStore = new Ext.data.JsonStore({
- url: objectUrlAddress,
- baseParams: {
- 'objectID': objectID
- },
- root: 'Fields',
- fields: [{
- name: 'Type',
- type: 'int'
- }, {
- name: 'Value'
- }, {
- name: 'IsRequired',
- type: 'bool'
- }, {
- name: 'Identifier'
- }, {
- name: 'Data'
- }],
- listeners: {
- load: function(obj, records) {
- Ext.each(records, function(rec) {
- var item = null;
- switch (rec.get('Type')) {
- case 0:
- item = new Ext.form.NumberField();
- item.id = rec.get('Identifier');
- item.fieldLabel = rec.get('Hint');
- var isRequired = rec.get('IsRequired');
- item.anchor = '100%';
- item.allowBlank = !isRequired;
- item.disabled = editDisabled;
- item.value = rec.get('Data');
- break;
- case 1:
- item = new Ext.form.NumberField();
- item.id = rec.get('Identifier');
- item.fieldLabel = rec.get('Hint');
- var isRequired = rec.get('IsRequired');
- item.anchor = '100%';
- item.allowBlank = !isRequired;
- item.allowDecimals = true;
- item.disabled = editDisabled;
- item.value = rec.get('Data');
- break;
- }
- if (item != null) {
- grid.add(item);
- tableValue = Ext.getCmp('propGrid').doLayout();
- source[item.fieldLabel] = tableValue;
- //grid.doLayout();
- }
- });
- grid.setSource(source);
- }
- }
- });
- grid = new Ext.grid.PropertyGrid({
- title: 'Properties Grid',
- id: 'propGrid',
- autoFill: true,
- autoHeight: true,
- width: 600
- });
Add Comment
Please, Sign In to add comment