this.dialog = Roo.factory({
xtype: 'LayoutDialog',
xns: Roo,
+ listeners : {
+ show : function (_self)
+ {
+ if(typeof(_this.data) != 'undefined'){
+ _this.grid.footer.onClick('first');
+ }
+ }
+ },
background : false,
closable : false,
collapsible : false,
fitContainer : true,
fitToframe : true,
region : 'west',
- tableName : 'Events',
- title : "Events",
+ tableName : 'Images',
+ title : "Images",
grid : {
xtype: 'Grid',
xns: Roo.grid,
listeners : {
- render : function() {
+ render : function()
+ {
_this.grid = this;
- //_this.dialog = Pman.Dialog.FILL_IN
+
if (_this.panel.active) {
this.footer.onClick('first');
}
+ },
+ rowdblclick : function (_self, rowIndex, e)
+ {
+
}
},
- autoExpandColumn : 'remarks',
+ autoExpandColumn : 'filename',
loadMask : true,
sm : {
xtype: 'RowSelectionModel',
listeners : {
afterselectionchange : function (_self)
{
- // load detail log in _this.viewPanel;
- if (!this.getSelected()) {
- this.viewPanel.setContent("Nothing Selected");
+ var selected = this.getSelected();
+
+ if (!selected) {
+ _this.viewPanel.setContent("Nothing Selected");
return;
}
- var id = this.getSelected().data.id;
- _this.viewPanel.load( { url : baseURL + "/Admin/EventView/" + id + ".html" });
+ Roo.log(selected);
+ _this.viewPanel.load( { url : baseURL + "/Roo/Events", method : 'GET' }, {_id : selected.data.id, _retrieve_source : 1}, function(oElement, bSuccess, oResponse){
+ Roo.log('res is here after load');
+ Roo.log(oElement);
+ Roo.log(bSuccess);
+ Roo.log(oResponse);
+ });
}
},
singleSelect : true
listeners : {
beforeload : function (_self, o)
{
- if (!Pman.buildCompleted) {
- return false;
- }
-
-
- if (! _this.personSel) {
- return false;
- }
o.params = o.params || {};
- o.params.person_id = _this.personSel.getValue();
- var act = _this.actionSel.getValue();
- if (act.length) {
- o.params.action = act;
- }
- var tbl = _this.affectSel.getValue();
- if (tbl.length) {
- o.params.on_table = tbl;
- }
- act = _this.dateFrom.getValue();
- if (act.format) {
- o.params['query[from]'] = act.format('Y-m-d');
- }
- act = _this.dateTo.getValue();
- if (act.format) {
- o.params['query[to]'] = act.format('Y-m-d');
- }
-
- /*
- act = _this.groupedCombo.getValue();
- o.params['query[grouped]'] = act;
- if (o.params['query[grouped]'] == 'gr') {
-
- if (!tbl.length) {
- Roo.MessageBox.alert("Error", "Select a table to group results on");
- return false;
- }
- // o.params['_columns'] =
- o.params['_distinct'] = 'on_id';
-
-
+ if(typeof(_this.data) == 'undefined'){
+ this.removeAll();
+ return false;
}
-
- */
-
-
+ Roo.log(_this.data);
+ o.params.action = 'AUTOSAVE';
}
},
remoteSort : true,
- sortInfo : { field: 'event_when', direction: 'DESC'},
+ sortInfo : { field : 'event_when', direction: 'DESC' },
+ proxy : {
+ xtype: 'HttpProxy',
+ xns: Roo.data,
+ method : 'GET',
+ url : baseURL + '/Roo/Events.php'
+ },
reader : {
xtype: 'JsonReader',
xns: Roo.data,
- totalProperty : 'total',
- root : 'data',
id : 'id',
+ root : 'data',
+ totalProperty : 'total',
fields : [
{
'name': 'id',
'type': 'int'
},
- {
- 'name': 'person_name',
- 'type': 'string'
- },
{
'name': 'event_when',
- 'type': 'date',
- 'dateFormat': 'Y-m-d'
- },
- {
- 'name': 'action',
- 'type': 'string'
- },
- {
- 'name': 'ipaddr',
- 'type': 'string'
- },
- {
- 'name': 'on_id',
- 'type': 'int'
- },
- {
- 'name': 'on_table',
- 'type': 'string'
- },
- {
- 'name': 'person_id',
- 'type': 'int'
- },
- {
- 'name': 'remarks',
- 'type': 'string'
- },
- {
- 'name': 'person_id_id',
- 'type': 'int'
- },
- {
- 'name': 'person_id_office_id',
- 'type': 'int'
- },
- {
- 'name': 'person_id_name',
- 'type': 'string'
- },
- {
- 'name': 'person_id_phone',
'type': 'string'
- },
- {
- 'name': 'person_id_fax',
- 'type': 'string'
- },
- {
- 'name': 'person_id_email',
- 'type': 'string'
- },
- {
- 'name': 'person_id_company_id',
- 'type': 'int'
- },
- {
- 'name': 'person_id_role',
- 'type': 'string'
- },
- {
- 'name': 'person_id_active',
- 'type': 'int'
- },
- {
- 'name': 'person_id_remarks',
- 'type': 'string'
- },
- {
- 'name': 'person_id_passwd',
- 'type': 'string'
- },
- {
- 'name': 'person_id_owner_id',
- 'type': 'int'
- },
- {
- 'name': 'person_id_lang',
- 'type': 'string'
- },
- {
- 'name': 'person_id_no_reset_sent',
- 'type': 'int'
- },
- {
- 'name': 'person_id_action_type',
- 'type': 'string'
- },
- {
- 'name': 'person_id_project_id',
- 'type': 'int'
- },
- {
- 'name': 'person_id_deleted_by',
- 'type': 'int'
- },
- {
- 'name': 'person_id_deleted_dt',
- 'type': 'date'
}
]
- },
- proxy : {
- xtype: 'HttpProxy',
- xns: Roo.data,
- method : 'GET',
- url : baseURL + '/Roo/Events.php'
}
},
footer : {
xtype: 'PagingToolbar',
xns: Roo,
- pageSize : 25,
- displayInfo : true,
- displayMsg : "Displaying Events {0} - {1} of {2}",
- emptyMsg : "No Events found"
+ displayInfo : false,
+ pageSize : 25
},
colModel : [
{
dataIndex : 'event_when',
header : 'Date',
width : 100,
- renderer : function(v) { return v ? v.dateFormat('d/m/Y H:i') : ''; }
- },
- {
- xtype: 'ColumnModel',
- xns: Roo.grid,
- dataIndex : 'on_table',
- header : 'Affected',
- width : 100,
- renderer : function(v) {
- return String.format('{0})', v ? v : '');
- }
+ renderer : function(v) { return String.format('{0}', v ? v.format('Y-m-d H:i:s') : ''); }
}
]
}
+ },
+ {
+ xtype: 'ContentPanel',
+ xns: Roo,
+ listeners : {
+ render : function (_self)
+ {
+ _this.viewPanel = _self;
+ }
+ },
+ autoScroll : true,
+ background : false,
+ fitContainer : true,
+ fitToFrame : true,
+ region : 'center'
}
],
center : {
xtype: 'LayoutRegion',
- xns: Roo,
- titlebar : false
+ xns: Roo
},
west : {
xtype: 'LayoutRegion',
xns: Roo,
split : true,
- width : 300
+ width : 200
},
buttons : [
{