this.dialog = Roo.factory({
xtype: 'LayoutDialog',
xns: Roo,
+ listeners : {
+ show : function (_self)
+ {
+ _this.grid.ds.load({});
+ }
+ },
height : 500,
modal : true,
resizable : false,
xns: Roo,
listeners : {
activate : function() {
- _this.panel = this;
+ _this.panel = this;
if (_this.grid) {
- _this.grid.footer.onClick('first');
+ // _this.grid.footer.onClick('first');
}
}
},
_this.grid = this;
//_this.dialog = Pman.Dialog.FILL_IN
if (_this.panel.active) {
- this.footer.onClick('first');
+ // this.footer.onClick('first');
}
},
rowdblclick : function (_self, rowIndex, e)
+ },
+ beforeload : function (_self, o)
+ {
+ if (!_this.data) {
+ return false;
+ }
+ o.params = Roo.apply(o.params || {}, {
+ person_id : _this.data.person_id,
+ onid : _this.data.onid,
+ ontable : _this.data.ontable,
+ method : _this.data.method
+ });
+
}
},
remoteSort : true,
]
}
},
- footer : {
- xtype: 'PagingToolbar',
- xns: Roo,
- pageSize : 25,
- displayInfo : true,
- displayMsg : "Displaying core_notify_recur{0} - {1} of {2}",
- emptyMsg : "No core_notify_recur found"
- },
toolbar : {
xtype: 'Toolbar',
xns: Roo,
}
}
},
- {
- xtype: 'ColumnModel',
- xns: Roo.grid,
- dataIndex : 'freq',
- header : 'Frequency',
- width : 70,
- renderer : function(v,x,r) {
-
- Roo.log(this);
- var cm = _this.grid.colModel;
- var ix = cm.findColumnIndex('freq');
- var ce = cm.getCellEditor(ix)
- var matches = ce.field.store.query('code',v);
- if (!matches.length) {
- return '';
- }
- return String.format('{0}', matches.first().data.title);
- },
- editor : {
- xtype: 'GridEditor',
- xns: Roo.grid,
- field : {
- xtype: 'ComboBox',
- xns: Roo.form,
- allowBlank : false,
- displayField : 'title',
- editable : false,
- fieldLabel : 'Country',
- hiddenName : 'freq',
- listWidth : 200,
- mode : 'local',
- name : 'freq_name',
- tpl : '<div class="x-grid-cell-text x-btn button"><b>{title}</b> </div>',
- triggerAction : 'all',
- valueField : 'code',
- width : 200,
- store : {
- xtype: 'SimpleStore',
- xns: Roo.data,
- data : [
- [ 'HOURLY' , 'Hourly at' ] ,
- [ 'DAILY' , 'Daily at'] ,
- [ 'WEEKLY' , 'Weekly at'] ,
- [ 'Montly' , 'Montly at']
- ],
- fields : ['code', 'title'],
- sortInfo : { field : 'title', direction: 'ASC' }
- }
- }
- }
- },
{
xtype: 'ColumnModel',
xns: Roo.grid,
width : 250,
renderer : function(v,x,r) {
+
+ if (v.length) {
+
+ var cm = _this.grid.colModel;
+
+ var ci = cm.getColumnByDataIndex(this.name);
+
+ var tv = [];
+ var vals = Roo.decode(v);
+ Roo.each(vals, function(k) {
+ var r = this.findRecord(this.valueField, k);
+ if(r){
+ tv.push(r.data[this.displayField]);
+ }else if(this.valueNotFoundText !== undefined){
+ tv.push( this.valueNotFoundText );
+ }
+ },ci.editor.field);
+
+
+ return String.format('{0}',tv.join(', '));
+
+
+
+ }
+
return String.format('{0}', r.data.freq_hour_name || v);
},
{
xtype: 'Button',
xns: Roo,
+ listeners : {
+ click : function (_self, e)
+ {
+ _this.dialog.hide();
+ }
+ },
text : "Done"
}
]