X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=blobdiff_plain;f=Pman.Dialog.CoreAutoSavePreview.bjs;h=73b12034ff67e4e9c18b8e1b01e82dd94de38d3a;hp=9c98fe4630fa29c9b685d33da6c8a52716817365;hb=HEAD;hpb=31ad15d6ecbbadb76c443c0bcf24835223238a7e diff --git a/Pman.Dialog.CoreAutoSavePreview.bjs b/Pman.Dialog.CoreAutoSavePreview.bjs index 9c98fe46..73b12034 100644 --- a/Pman.Dialog.CoreAutoSavePreview.bjs +++ b/Pman.Dialog.CoreAutoSavePreview.bjs @@ -1,135 +1,167 @@ { - "id": "roo-file-208", - "name": "Pman.Dialog.CoreAutoSavePreview", - "parent": "", - "title": "", - "path": "/home/edward/gitlive/Pman.Core/Pman.Dialog.CoreAutoSavePreview.bjs", - "items": [ + "name" : "Pman.Dialog.CoreAutoSavePreview", + "parent" : "", + "title" : "", + "path" : "/home/johns/gitlive/Pman.Core/Pman.Dialog.CoreAutoSavePreview.bjs", + "permname" : "", + "modOrder" : "001", + "strings" : { + "53e5aa2c97fef1555d2511de8218c544" : "By", + "87f9f735a1d36793ceaecd4e47124b63" : "Events", + "ea4788705e6873b424c65e91c2846b19" : "Cancel", + "bd88a20b53a47f7b5704a83a15ff5506" : "Saved Version", + "44749712dbec183e983dcd78a7736c41" : "Date", + "e0aa021e21dddbd6d8cecec71e9cf564" : "OK" + }, + "items" : [ + { + "listeners" : { + "show" : "function (_self)\n{\n if(typeof(_this.data) != 'undefined'){\n _this.grid.footer.onClick('first');\n }\n \n}" + }, + "modal" : true, + "collapsible" : false, + "background" : false, + "title" : "Saved Version", + "xtype" : "LayoutDialog", + "width" : 800, + "$ xns" : "Roo", + "closable" : false, + "resizable" : false, + "height" : 500, + "items" : [ + { + "xtype" : "LayoutRegion", + "$ xns" : "Roo", + "* prop" : "center" + }, + { + "xtype" : "LayoutRegion", + "$ xns" : "Roo", + "width" : 200, + "split" : true, + "* prop" : "west" + }, + { + "listeners" : { + "|activate" : "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}" + }, + "fitToframe" : true, + "background" : false, + "region" : "west", + "title" : "Events", + "xtype" : "GridPanel", + "fitContainer" : true, + "$ xns" : "Roo", + "tableName" : "Events", + "items" : [ + { + "listeners" : { + "|render" : "function() \n{\n _this.grid = this; \n \n if (_this.panel.active) {\n this.footer.onClick('first');\n }\n}" + }, + "autoExpandColumn" : "event_when", + "xtype" : "Grid", + "loadMask" : true, + "$ xns" : "Roo.grid", + "* prop" : "grid", + "items" : [ { - "background": false, - "closable": false, - "collapsible": false, - "height": 500, - "modal": true, - "resizable": false, - "title": "Saved Version", - "width": 800, - "xtype": "LayoutDialog", - "|xns": "Roo", - "items": [ - { - "*prop": "center", - "xtype": "LayoutRegion", - "|xns": "Roo" - }, - { - "*prop": "west", - "split": true, - "width": 200, - "xtype": "LayoutRegion", - "|xns": "Roo" - }, - { - "listeners": { - "|activate": "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}" - }, - "background": false, - "fitContainer": true, - "fitToframe": true, - "region": "west", - "tableName": "Images", - "title": "Images", - "xtype": "GridPanel", - "|xns": "Roo", - "items": [ - { - "listeners": { - "|render": "function() \n{\n _this.grid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n if (_this.panel.active) {\n this.footer.onClick('first');\n }\n}", - "|rowdblclick": "function (_self, rowIndex, e)\n{\n\n}\n" - }, - "*prop": "grid", - "autoExpandColumn": "filename", - "loadMask": true, - "xtype": "Grid", - "|xns": "Roo.grid", - "items": [ - { - "*prop": "dataSource", - "xtype": "Store", - "remoteSort": true, - "|sortInfo": "{ field : 'filename', direction: 'ASC' }", - "|xns": "Roo.data", - "items": [ - { - "*prop": "proxy", - "xtype": "HttpProxy", - "method": "GET", - "|url": "baseURL + '/Roo/Images.php'", - "|xns": "Roo.data" - }, - { - "*prop": "reader", - "id": "id", - "root": "data", - "totalProperty": "total", - "xtype": "JsonReader", - "|fields": "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'event_when',\n 'type': 'string'\n }\n]", - "|xns": "Roo.data" - } - ] - }, - { - "*prop": "footer", - "displayInfo": false, - "pageSize": 25, - "xtype": "PagingToolbar", - "|xns": "Roo" - }, - { - "*prop": "colModel[]", - "dataIndex": "event_when", - "header": "Date", - "width": 100, - "xtype": "ColumnModel", - "|renderer": "function(v) { return String.format('{0}', v ? v.format('Y-m-d H:i:s') : ''); }", - "|xns": "Roo.grid" - } - ] - } - ] - }, - { - "listeners": { - "render": "function (_self)\n{\n _this.viewPanel = _self;\n}" - }, - "background": false, - "fitContainer": true, - "fitToFrame": true, - "region": "center", - "xtype": "ContentPanel", - "|xns": "Roo" - }, - { - "listeners": { - "|click": "function() {\n _this.dialog.hide();\n}" - }, - "*prop": "buttons[]", - "text": "Cancel", - "xtype": "Button", - "|xns": "Roo" - }, - { - "listeners": { - "|click": "function() {\n _this.dialog.hide();\n}" - }, - "*prop": "buttons[]", - "text": "OK", - "xtype": "Button", - "|xns": "Roo" - } - ] + "listeners" : { + "afterselectionchange" : "function (_self)\n{\n var selected = this.getSelected();\n \n _this.source = '';\n \n if(!selected){\n _this.viewPanel.setContent(\"Please select an saved version on the left\"); \n return;\n }\n \n _this.viewPanel.load( { url : baseURL + \"/Roo/Events\", method : 'GET' }, {_id : selected.data.id, _retrieve_source : 1}, function(oElement, bSuccess, oResponse){\n \n var res = Roo.decode(oResponse.responseText);\n \n if(!bSuccess || !res.success){\n _this.viewPanel.setContent(\"Load data failed?!\");\n }\n \n if(typeof(res.data) === 'string'){\n _this.viewPanel.setContent(res.data);\n return;\n }\n \n if(!_this.data.successFn){\n Roo.MessageBox.alert('Error', 'Please setup the successFn');\n return;\n }\n \n _this.source = _this.data.successFn(res);\n\n _this.viewPanel.setContent(_this.source);\n \n });\n}" + }, + "xtype" : "RowSelectionModel", + "singleSelect" : true, + "$ xns" : "Roo.grid", + "* prop" : "sm" + }, + { + "listeners" : { + "beforeload" : "function (_self, o)\n{\n o.params = o.params || {};\n \n if(typeof(_this.data) == 'undefined'){\n this.removeAll();\n return false;\n }\n\n var d = Roo.apply({}, _this.data);\n delete d.successFn;\n\n Roo.apply(o.params, d);\n \n}", + "load" : "function (_self, records, options)\n{\n var sm = _this.grid.getSelectionModel();\n if (!sm.getSelections().length) {\n sm.selectFirstRow();\n \n sm.fireEvent('afterselectionchange', sm);\n }\n}" + }, + "xtype" : "Store", + "remoteSort" : true, + "$ sortInfo" : "{ field : 'event_when', direction: 'DESC' }", + "$ xns" : "Roo.data", + "* prop" : "dataSource", + "items" : [ + { + "$ url" : "baseURL + '/Roo/Events.php'", + "method" : "GET", + "xtype" : "HttpProxy", + "$ xns" : "Roo.data", + "* prop" : "proxy" + }, + { + "id" : "id", + "root" : "data", + "xtype" : "JsonReader", + "$ fields" : "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'event_when',\n 'type': 'string'\n }\n]", + "$ xns" : "Roo.data", + "* prop" : "reader", + "totalProperty" : "total" + } + ] + }, + { + "pageSize" : 25, + "xtype" : "PagingToolbar", + "$ xns" : "Roo", + "displayInfo" : false, + "* prop" : "footer" + }, + { + "xtype" : "ColumnModel", + "header" : "Date", + "width" : 100, + "$ renderer" : "function(v) { return String.format('{0}', v ? v.format('Y-m-d H:i:s') : ''); }", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "event_when" + }, + { + "xtype" : "ColumnModel", + "width" : 100, + "header" : "By", + "$ renderer" : "function(v) { return String.format('{0}', v ); }", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "person_id_name" } - ], - "permname": "", - "modOrder": "001" + ] + } + ] + }, + { + "listeners" : { + "render" : "function (_self)\n{\n _this.viewPanel = _self;\n}" + }, + "autoScroll" : true, + "fitToFrame" : true, + "background" : false, + "region" : "center", + "xtype" : "ContentPanel", + "fitContainer" : true, + "$ xns" : "Roo" + }, + { + "listeners" : { + "|click" : "function() {\n _this.dialog.hide();\n}" + }, + "text" : "Cancel", + "xtype" : "Button", + "$ xns" : "Roo", + "* prop" : "buttons[]" + }, + { + "listeners" : { + "|click" : "function() {\n\n _this.dialog.hide();\n \n if (_this.callback && _this.source != '') {\n _this.callback.call(this, _this.source);\n }\n}" + }, + "text" : "OK", + "xtype" : "Button", + "$ xns" : "Roo", + "* prop" : "buttons[]" + } + ] + } + ] } \ No newline at end of file