pulldown js error
[Pman.Admin] / Pman.Dialog.AdminEnumImages.bjs
1 {
2     "name" : "Pman.Dialog.AdminEnumImages",
3     "parent" : "",
4     "title" : "",
5     "path" : "/home/michael/gitlive/Pman.Admin/Pman.Dialog.AdminEnumImages.bjs",
6     "permname" : "",
7     "modOrder" : "001",
8     "items" : [
9         {
10             "listeners" : {
11                 "show" : "function (_self)\n{\n    _this.grid.footer.onClick('first');\n}"
12             },
13             "modal" : true,
14             "title" : "Add / Edit Images",
15             "xtype" : "LayoutDialog",
16             "width" : 900,
17             "$ xns" : "Roo",
18             "height" : 500,
19             "items" : [
20                 {
21                     "xtype" : "LayoutRegion",
22                     "$ xns" : "Roo",
23                     "* prop" : "center"
24                 },
25                 {
26                     "listeners" : {
27                         "|activate" : "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
28                     },
29                     "fitToframe" : true,
30                     "background" : false,
31                     "region" : "center",
32                     "title" : "Images",
33                     "xtype" : "GridPanel",
34                     "fitContainer" : true,
35                     "$ xns" : "Roo",
36                     "tableName" : "Images",
37                     "items" : [
38                         {
39                             "listeners" : {
40                                 "|rowdblclick" : "function (_self, rowIndex, e)\n{\n  \n   var s =  _self.getDataSource().getAt(rowIndex);\n     Pman.Dialog.PressReleaseImage.show(s.data, function() {\n                _this.grid.footer.onClick('first');\n               }); \n}",
41                                 "|render" : "function() { \n    _this.grid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    //if (_this.panel.active) {\n    //   this.footer.onClick('first');\n    //}\n}"
42                             },
43                             "autoExpandColumn" : "title",
44                             "xtype" : "Grid",
45                             "loadMask" : true,
46                             "$ xns" : "Roo.grid",
47                             "* prop" : "grid",
48                             "items" : [
49                                 {
50                                     "listeners" : {
51                                         "|beforeload" : "function (_self, o)\n{\n    //o.params.ontable = 'Companies';\n    \n  //   o.params.imgtype = 'PressRelease';\n    \n    o.params = o.params || {};\n    o.params.onid = _this.data.onid;\n    o.params.ontable = 'core_enum';\n    Roo.log(_this);\n    \n}",
52                                         "|load" : "function (_self, records, options)\n{\n _this.panel.el.unmask();\n}"
53                                     },
54                                     "xtype" : "Store",
55                                     "remoteSort" : true,
56                                     "$ sortInfo" : "{ field: 'created' , direction: 'DESC' }",
57                                     "$ xns" : "Roo.data",
58                                     "* prop" : "dataSource",
59                                     "items" : [
60                                         {
61                                             "id" : "id",
62                                             "root" : "data",
63                                             "xtype" : "JsonReader",
64                                             "$ fields" : "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'filename',\n        'type': 'string'\n    },\n    {\n        'name': 'ontable',\n        'type': 'string'\n    },\n    {\n        'name': 'onid',\n        'type': 'int'\n    },\n    {\n        'name': 'mimetype',\n        'type': 'string'\n    },\n    {\n        'name': 'width',\n        'type': 'int'\n    },\n    {\n        'name': 'height',\n        'type': 'int'\n    },\n    {\n        'name': 'filesize',\n        'type': 'int'\n    },\n    {\n        'name': 'displayorder',\n        'type': 'int'\n    },\n    {\n        'name': 'language',\n        'type': 'string'\n    },\n    {\n        'name': 'parent_image_id',\n        'type': 'int'\n    },\n    {\n        'name': 'created',\n        'type': 'date',\n        'dateFormat' : 'Y-m-d H:i:s'\n    },\n    {\n        'name': 'imgtype',\n        'type': 'string'\n    },\n    {\n        'name': 'linkurl',\n        'type': 'string'\n    },\n    {\n        'name': 'descript',\n        'type': 'string'\n    },\n    {\n        'name': 'title',\n        'type': 'string'\n    }\n]",
65                                             "$ xns" : "Roo.data",
66                                             "* prop" : "reader",
67                                             "totalProperty" : "total"
68                                         },
69                                         {
70                                             "$ url" : "baseURL + '/Roo/Images.php'",
71                                             "method" : "GET",
72                                             "xtype" : "HttpProxy",
73                                             "$ xns" : "Roo.data",
74                                             "* prop" : "proxy"
75                                         }
76                                     ]
77                                 },
78                                 {
79                                     "pageSize" : 25,
80                                     "xtype" : "PagingToolbar",
81                                     "emptyMsg" : "No Images found",
82                                     "$ xns" : "Roo",
83                                     "displayInfo" : true,
84                                     "displayMsg" : "Displaying Images  {0} - {1} of {2}",
85                                     "* prop" : "footer"
86                                 },
87                                 {
88                                     "xtype" : "Toolbar",
89                                     "$ xns" : "Roo",
90                                     "* prop" : "toolbar",
91                                     "items" : [
92                                         {
93                                             "listeners" : {
94                                                 "|click" : "function()\n{\n            \n    //var sel = Pman.Tab.PressReleaseCompanies  ? Pman.Tab.PressReleaseCompanies.grid.getSelectionModel().getSelected() : false\n     \n    Pman.Dialog.Image.show({\n        id : 0, \n        ontable: 'core_enum',\n        onid: _this.data.onid,\n        imgtype : ''\n    }, function(data){\n        if (!data) { return; } \n        _this.grid.footer.onClick('first');\n    }); \n\n}       "
95                                             },
96                                             "text" : "Add",
97                                             "xtype" : "Button",
98                                             "cls" : "x-btn-text-icon",
99                                             "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
100                                             "$ xns" : "Roo.Toolbar"
101                                         },
102                                         {
103                                             "listeners" : {
104                                                 "|click" : "function()\n{\n    var s = _this.grid.getSelectionModel().getSelections();\n    if (!s || s.length != 1) {\n        Roo.MessageBox.alert(\"Error\", \"Select a single image to edit\");\n       return;\n     }\n     var data = _this.grid.getDataSource().getById(s[0].data.id).data;\n    \n             Pman.Dialog.PressReleaseImage.show(data, function() {\n                _this.grid.footer.onClick('first');\n               }); \n            \n        }\n        "
105                                             },
106                                             "text" : "Edit",
107                                             "xtype" : "Button",
108                                             "cls" : "x-btn-text-icon",
109                                             "$ icon" : "Roo.rootURL + 'images/default/tree/leaf.gif'",
110                                             "$ xns" : "Roo"
111                                         },
112                                         {
113                                             "listeners" : {
114                                                 "|click" : "function()\n        {\n        Pman.genericDelete(_this, 'Images'); \n        }\n        "
115                                             },
116                                             "text" : "Delete",
117                                             "xtype" : "Button",
118                                             "cls" : "x-btn-text-icon",
119                                             "$ icon" : "rootURL + '/Pman/templates/images/trash.gif'",
120                                             "$ xns" : "Roo.Toolbar"
121                                         }
122                                     ]
123                                 },
124                                 {
125                                     "xtype" : "ColumnModel",
126                                     "sortable" : true,
127                                     "width" : 100,
128                                     "header" : "Created",
129                                     "$ renderer" : "function(v,x,r) {\n       return String.format('{0}<br/><i>{1}</i><br/>{2}<br/><i>{3}x{4}</i>',\n            v.format('d/M/Y'), r.data.mimetype, r.data.filename,\n    r.data.width, r.data.height\n    ); \n}\n     ",
130                                     "$ xns" : "Roo.grid",
131                                     "* prop" : "colModel[]",
132                                     "dataIndex" : "created"
133                                 },
134                                 {
135                                     "xtype" : "ColumnModel",
136                                     "header" : "Image",
137                                     "width" : 100,
138                                     "$ renderer" : "function(v,x,r) { return String.format('<img src=\"{0}/Images/Thumb/100/{1}/{2}\" width=\"100\">', baseURL, v, r.data.filename); }",
139                                     "$ xns" : "Roo.grid",
140                                     "* prop" : "colModel[]",
141                                     "dataIndex" : "id"
142                                 },
143                                 {
144                                     "xtype" : "ColumnModel",
145                                     "header" : "Title",
146                                     "width" : 100,
147                                     "$ renderer" : "function(v,x,r) {\n//     var surl = r.json.url.replace(/\\/release.php\\/Images\\//, '/i/').replace(/\\/([0-9]+)\\/.*$/, '/$1');;\n  //   var svurl = r.json.url_view.replace(/\\/release.php\\/Images\\//, '/i/').replace(/\\/([0-9]+)\\/.*$/, '/$1');;\n    //  return String.format(\n      //    'Download Url : <a href=\"http://{0}{1}\" target=\"_new\">http://{0}{1}</a>' + \n        //  '<br/>View Url : <a href=\"http://{0}{2}\" target=\"_new\">http://{0}{2}</a>' + \n          //'<br/><b>{3}</b><br/>{4}</i>', \n         // window.location.host, surl, svurl,\n          // v, r.json.descript); \n     \n    }",
148                                     "$ xns" : "Roo.grid",
149                                     "* prop" : "colModel[]",
150                                     "dataIndex" : "title"
151                                 }
152                             ]
153                         }
154                     ]
155                 },
156                 {
157                     "listeners" : {
158                         "click" : "function (_self, e)\n{\n    _this.dialog.hide();\n    _this.callback(true);\n}"
159                     },
160                     "text" : "Close",
161                     "xtype" : "Button",
162                     "$ xns" : "Roo",
163                     "* prop" : "buttons[]"
164                 }
165             ]
166         }
167     ]
168 }