closable : false,
collapsible : false,
height : 420,
+ modal : true,
resizable : false,
title : "Edit / Create mtrack_repos",
width : 400,
actioncomplete : function(_self,action)
{
if (action.type == 'setdata') {
- //_this.dialog.el.mask("Loading");
- //this.load({ method: 'GET', params: { '_id' : _this.data.id }});
+ if (_this.data.id) {
+ this.load({ method: 'GET', params: { '_id' : _this.data.id }});
+ }
return;
}
if (action.type == 'load') {
- _this.dialog.el.unmask();
+
return;
}
if (action.type =='submit') {
- _this.dialog.el.unmask();
+
_this.dialog.hide();
if (_this.callback) {
style : 'margin:10px;',
url : baseURL + '/Roo/mtrack_repos.php',
items : [
+ {
+ xtype: 'ComboBox',
+ xns: Roo.form,
+ allowBlank : false,
+ alwaysQuery : true,
+ displayField : 'name',
+ editable : false,
+ emptyText : "Select Project",
+ fieldLabel : 'Project',
+ forceSelection : false,
+ hiddenName : 'project_id',
+ listWidth : 400,
+ loadingText : "Searching...",
+ minChars : 2,
+ name : 'project_id_name',
+ pageSize : 20,
+ qtip : "Select Projects",
+ queryParam : 'query[name]',
+ selectOnFocus : true,
+ tpl : '<div class="x-grid-cell-text x-btn button"><b>{code}</b> {name} </div>',
+ triggerAction : 'all',
+ typeAhead : true,
+ valueField : 'id',
+ width : 200,
+ store : {
+ xtype: 'Store',
+ xns: Roo.data,
+ listeners : {
+ beforeload : function (_self, o){
+ o.params = o.params || {};
+ // set more here
+ }
+ },
+ remoteSort : true,
+ sortInfo : { direction : 'ASC', field: 'code' },
+ proxy : {
+ xtype: 'HttpProxy',
+ xns: Roo.data,
+ method : 'GET',
+ url : baseURL + '/Roo/core_project'
+ },
+ reader : {
+ xtype: 'JsonReader',
+ xns: Roo.data,
+ id : 'id',
+ root : 'data',
+ totalProperty : 'total',
+ fields : [{"name":"id","type":"int"},{"name":"name","type":"string"}]
+ }
+ }
+ },
{
xtype: 'TextField',
xns: Roo.form,
name : 'serverurl',
width : 200
},
- {
- xtype: 'TextField',
- xns: Roo.form,
- fieldLabel : 'Parent',
- name : 'parent',
- width : 200
- },
- {
- xtype: 'TextField',
- xns: Roo.form,
- fieldLabel : 'Clonedfrom',
- name : 'clonedfrom',
- width : 75
- },
- {
- xtype: 'ComboBox',
- xns: Roo.form,
- allowBlank : false,
- displayField : 'name',
- emptyText : "Select Projects",
- fieldLabel : 'Projects',
- forceSelection : true,
- hiddenName : 'project_id',
- listWidth : 400,
- loadingText : "Searching...",
- minChars : 2,
- name : 'project_id_name',
- pageSize : 20,
- qtip : "Select Projects",
- queryParam : 'query[name]',
- selectOnFocus : true,
- tpl : '<div class="x-grid-cell-text x-btn button"><b>{code}</b>{name} </div>',
- triggerAction : 'all',
- typeAhead : true,
- valueField : 'id',
- width : 300,
- store : {
- xtype: 'Store',
- xns: Roo.data,
- remoteSort : true,
- sortInfo : { direction : 'ASC', field: 'id' },
- listeners : {
- beforeload : function (_self, o){
- o.params = o.params || {};
- // set more here
- }
- },
- proxy : {
- xtype: 'HttpProxy',
- xns: Roo.data,
- method : 'GET',
- url : baseURL + '/Roo/Projects.php'
- },
- reader : {
- xtype: 'JsonReader',
- xns: Roo.data,
- id : 'id',
- root : 'data',
- totalProperty : 'total',
- fields : [{"name":"id","type":"int"},{"name":"name","type":"string"}]
- }
- }
- },
- {
- xtype: 'TextField',
- xns: Roo.form,
- fieldLabel : 'Project',
- name : 'project_id',
- width : 75
- },
{
xtype: 'Hidden',
xns: Roo.form,
// do some checks?
- _this.dialog.el.mask("Saving");
+
_this.form.doAction("submit");
}