1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Pman.Dialog.CmsCategory = {
10 show : function(data, cb)
18 this.dialog.show(this.data._el);
21 this.form.setValues(data);
22 this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
30 this.dialog = Roo.factory({
31 xtype: 'LayoutDialog',
36 title : "Edit Category",
43 xtype: 'ContentPanel',
53 actionfailed : function (_self, action)
55 _this.dialog.el.unmask();
56 Pman.standardActionFailed(_self, action);
58 actioncomplete : function (_self, action)
61 if (action.type =='submit') {
63 _this.dialog.el.unmask();
67 _this.callback.call(_this, _this.form.getValues());
74 rendered : function (_self)
80 style : 'margin: 5px',
81 url : baseURL + '/Roo/Category.php',
86 fieldLabel : 'Parent',
87 name : 'parent_id_title',
101 fieldLabel : 'Colour',
108 fieldLabel : 'Visible',
120 fieldLabel : 'Page text',
147 tableName : 'Images',
150 activate : function() {
153 //_this.grid.footer.onClick('first');
161 autoExpandColumn : 'filename',
164 render : function() {
166 //_this.dialog = Pman.Dialog.FILL_IN
167 if (_this.panel.active) {
168 //this.footer.onClick('first');
175 reader : Pman.Readers.Images,
177 beforeload : function (_self, o)
179 if (!_this.data.id) {
182 o.params = o.params || {};
183 o.params.onid = _this.data.id;
184 o.params.ontable = 'Category';
191 url : baseURL + '/Roo/Images.php'
202 cls : 'x-btn-text-icon',
203 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
207 Pman.Dialog.Image.show( { id : 0, onid: _this.data.id, ontable: 'Category' }, function(data) {
208 _this.grid.getDataSource().load();
209 Pman.Dialog.CmsImage.show(data, function() {
210 _this.grid.getDataSource().load();
223 cls : 'x-btn-text-icon',
224 icon : Roo.rootURL + 'images/default/tree/leaf.gif',
228 var s = _this.grid.getSelectionModel().getSelections();
229 if (!s.length || (s.length > 1)) {
230 Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
233 var data = _this.grid.getDataSource().getById(s[0].data.id).data;
234 Pman.Dialog.CmsImage.show(data, function() {
235 _this.grid.getDataSource().load();
245 cls : 'x-btn-text-icon',
246 icon : rootURL + '/Pman/templates/images/trash.gif',
250 Pman.genericDelete(_this, _this.panel.tableName);
258 xtype: 'ColumnModel',
263 renderer : function(v,x,r) { return String.format('<img src="{0}/Images/Thumb/100/{1}/{2}">', baseURL, v, r.data.filename); }
266 xtype: 'ColumnModel',
270 dataIndex : 'filename',
271 renderer : function(v,x,r) { return String.format('{0}<br/><i qtip="{1}">{1}</i>', v, r.data.linkurl); }
278 xtype: 'LayoutRegion',
283 xtype: 'LayoutRegion',
312 _this.dialog.el.mask("Saving");
314 _this.form.doAction("submit");