xns: Roo,
closable : false,
collapsible : false,
- height : 380,
+ height : 350,
modal : true,
resizable : false,
- title : "Edit / Create mtrack_milestone",
- width : 450,
+ title : "Edit / Create Milestone",
+ width : 400,
items : [
{
xtype: 'ContentPanel',
actioncomplete : function(_self,action)
{
if (action.type == 'setdata') {
- if (_this.data.id) {
-
- this.load({ method: 'GET', params: { '_id' : _this.data.id }});
- return;
+ if (_this.data.id) {
+ this.load({ method: 'GET', params: { '_id' : _this.data.id }});
}
return;
+
}
if (action.type == 'load') {
-
+
return;
}
if (action.type =='submit') {
-
+
_this.dialog.hide();
if (_this.callback) {
style : 'margin:10px;',
url : baseURL + '/Roo/mtrack_milestone.php',
items : [
+ {
+ xtype: 'TextField',
+ xns: Roo.form,
+ fieldLabel : 'Name',
+ name : 'name',
+ width : 200
+ },
{
xtype: 'ComboBox',
xns: Roo.form,
allowBlank : false,
- alwaysQuery : true,
displayField : 'name',
- editable : 'false',
+ editable : false,
emptyText : "Select Project",
fieldLabel : 'Project',
forceSelection : true,
loadingText : "Searching...",
minChars : 2,
name : 'project_id_name',
- pageSize : 20,
+ pageSize : 50,
qtip : "Select Projects",
queryParam : 'query[name]',
selectOnFocus : true,
- tpl : '<div class="x-grid-cell-text x-btn button"><b>{CODE} - {name}</b> </div>',
+ tpl : '<div class="x-grid-cell-text x-btn button"><b>{code}</b> {name}</div>',
triggerAction : 'all',
- typeAhead : true,
valueField : 'id',
- width : 300,
+ width : 200,
store : {
xtype: 'Store',
xns: Roo.data,
}
},
remoteSort : true,
- sortInfo : { direction : 'ASC', field: 'name' },
+ sortInfo : { direction : 'ASC', field: 'code' },
proxy : {
xtype: 'HttpProxy',
xns: Roo.data,
method : 'GET',
- url : baseURL + '/Roo/Projects.php'
+ url : baseURL + '/Roo/core_project'
},
reader : {
xtype: 'JsonReader',
}
}
},
- {
- xtype: 'TextField',
- xns: Roo.form,
- fieldLabel : 'Name',
- name : 'name',
- width : 300
- },
{
xtype: 'TextArea',
xns: Roo.form,
fieldLabel : 'Description',
- height : 100,
name : 'description',
- width : 300
+ width : 200,
+ height : 100
},
{
- xtype: 'ComboBoxLister',
+ xtype: 'DateField',
xns: Roo.form,
- allowBlank : 'false',
- alwaysQuery : true,
- boxWidth : 300,
- displayField : 'name',
- editable : true,
- emptyText : "Select Milestones",
- fieldLabel : 'Depends On',
- forceSelection : true,
- hiddenName : 'depends_on_vals',
- listWidth : 400,
- loadingText : "Searching...",
- minChars : 2,
- name : 'depends_on_vals',
- pageSize : 20,
- qtip : "Select Milestones",
- queryParam : 'query[name]',
- selectOnFocus : true,
- tpl : '<div class="x-grid-cell-text x-btn button"><b>{name}</b> </div>',
- triggerAction : 'all',
- typeAhead : true,
- valueField : 'id',
- width : 150,
- setList : function(ar) {
- Roo.log('setlist');
- Roo.log(ar);
-
- var _this = this;
- Roo.each(ar, function(a) {
- _this.addItem(a);
- });
- },
- toList : function() {
- var ret = [];
- this.items.each(function(a) {
- ret.push(a.data);
- });
- return ret;
- },
- store : {
- xtype: 'Store',
- xns: Roo.data,
- listeners : {
- beforeload : function (_self, o){
- o.params = o.params || {};
- // set more here
- var pid = _this.form.findField('project_id').getValue() * 1;
- if (!pid) {
- Roo.MessageBox.alert("Error","Select Project");
- return false;
- }
- o.params.project_id = pid;
- }
- },
- remoteSort : true,
- sortInfo : { direction : 'ASC', field: 'name' },
- proxy : {
- xtype: 'HttpProxy',
- xns: Roo.data,
- method : 'GET',
- url : baseURL + '/Roo/Mtrack_milestone.php'
- },
- reader : {
- xtype: 'JsonReader',
- xns: Roo.data,
- id : 'id',
- root : 'data',
- totalProperty : 'total',
- fields : [{"name":"id","type":"int"},{"name":"name","type":"string"}]
- }
- }
+ altFormats : 'Y-m-d H:i:s',
+ fieldLabel : 'Startdate',
+ format : 'Y-m-d',
+ name : 'startdate',
+ width : 100
},
{
- xtype: 'Row',
+ xtype: 'DateField',
xns: Roo.form,
- items : [
- {
- xtype: 'DateField',
- xns: Roo.form,
- fieldLabel : 'Startdate',
- format : 'Y-m-d',
- name : 'startdate',
- width : 75,
- value : (function() { (new Date()).format('Y-m-d')})()
- },
- {
- xtype: 'DateField',
- xns: Roo.form,
- fieldLabel : 'Duedate',
- format : 'Y-m-d',
- name : 'duedate',
- width : 75
- }
- ]
+ altFormats : 'Y-m-d H:i:s',
+ fieldLabel : 'Duedate',
+ format : 'Y-m-d',
+ name : 'duedate',
+ width : 100
},
{
xtype: 'DateField',
xns: Roo.form,
+ altFormats : 'Y-m-d H:i:s',
fieldLabel : 'Completed',
format : 'Y-m-d',
name : 'completed',
- width : 75
+ width : 100
+ },
+ {
+ xtype: 'Checkbox',
+ xns: Roo.form,
+ boxLabel : 'On hold',
+ fieldLabel : 'Status',
+ inputValue : 1,
+ name : 'on_hold',
+ valueOff : 0
},
{
xtype: 'Hidden',
// do some checks?
- _this.dialog.el.mask("Saving");
+
_this.form.doAction("submit");
}