Sha256: 1fa99c4e8e2d115de328f665deb6ff298669b4a79513a6396346c9e048dd094e
Contents?: true
Size: 1.71 KB
Versions: 1
Compression:
Stored size: 1.71 KB
Contents
Ext.define('FastUI.view.VCustomForm', { extend:'Ext.Panel', tab:{}, url: 'fastui', method: 'POST', autoEl: {tag: 'form'}, title:'Custom Form', bodyPadding:5, layout:'anchor', border:false, html:'<input name="s11" /> <input name="g22" />', initComponent:function () { this.title = this.getValue('title'); this.callParent(); }, getValue:function(key){ return this.tab.valueObject[key]; }, getMEntity:function(){ return this.tab.valueObject.entity; }, cmdEdit: function () { var id = this.tab.getVGrid().selectedId(); this.url = this.tab.rest.updatePath(id); this.method = 'PUT'; Ext.Ajax.request({ url: this.tab.rest.editPath(id), success: function (response) { var data = Ext.decode(response.responseText); this.setValues(data); }, failure: function () { Ext.MessageBox.alert("提示", "操作失败!") }, scope: this }); }, cmdCreate:function(){ this.url = this.tab.rest.createPath(); this.method = 'POST'; this.getEl().dom.reset(); }, cmdSave:function(){ Ext.Ajax.request( { url : this.url, method : this.method, form : this.id, success: function () { Ext.MessageBox.alert("提示", "操作成功!") }, failure: function () { Ext.MessageBox.alert("提示", "操作失败!") }, scope: this }); }, setValues: function (opt) { } });
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
fastui-0.1.3 | app/assets/javascripts/fastui/app/view/VCustomForm.js |