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',
52 style : 'margin: 5px',
53 url : baseURL + '/Roo/Category.php',
56 actionfailed : function (_self, action)
58 _this.dialog.el.unmask();
59 Pman.standardActionFailed(_self, action);
61 actioncomplete : function (_self, action)
64 if (action.type =='submit') {
66 _this.dialog.el.unmask();
70 _this.callback.call(_this, _this.form.getValues());
75 if (action.type = 'setdata') {
76 _this.grid.getDataSource().load();
80 rendered : function (_self)
96 fieldLabel : 'Parent ',
97 name : 'parent_id_title',
98 hiddenName : 'parent_id',
99 qtip : "Select Parent ",
100 emptyText : "Select Parent ",
101 selectOnFocus : true,
106 displayField : 'title',
109 forceSelection : true,
110 triggerAction : 'all',
111 tpl : '<div class="x-grid-cell-text x-btn button"><b>{title}</b> </div>',
112 queryParam : 'query[title]',
113 loadingText : "Searching...",
119 reader : Pman.Readers.Category,
123 url : baseURL + '/Roo/Category.php',
132 fieldLabel : 'Title',
138 fieldLabel : 'Colour',
145 fieldLabel : 'Visible',
157 fieldLabel : 'Page text',
179 tableName : 'Images',
182 activate : function() {
185 //_this.grid.footer.onClick('first');
193 autoExpandColumn : 'filename',
196 render : function() {
198 //_this.dialog = Pman.Dialog.FILL_IN
199 if (_this.panel.active) {
200 //this.footer.onClick('first');
207 reader : Pman.Readers.Images,
209 beforeload : function (_self, o)
211 if (!_this.data.id) {
214 o.params = o.params || {};
215 o.params.onid = _this.data.id;
216 o.params.ontable = 'Category';
223 url : baseURL + '/Roo/Images.php'
234 cls : 'x-btn-text-icon',
235 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
239 Pman.Dialog.Image.show( { id : 0, onid: _this.data.id, ontable: 'Category' }, function(data) {
240 _this.grid.getDataSource().load();
241 Pman.Dialog.CmsImage.show(data, function() {
242 _this.grid.getDataSource().load();
255 cls : 'x-btn-text-icon',
256 icon : Roo.rootURL + 'images/default/tree/leaf.gif',
260 var s = _this.grid.getSelectionModel().getSelections();
261 if (!s.length || (s.length > 1)) {
262 Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
265 var data = _this.grid.getDataSource().getById(s[0].data.id).data;
266 Pman.Dialog.CmsImage.show(data, function() {
267 _this.grid.getDataSource().load();
277 cls : 'x-btn-text-icon',
278 icon : rootURL + '/Pman/templates/images/trash.gif',
282 Pman.genericDelete(_this, _this.panel.tableName);
290 xtype: 'ColumnModel',
295 renderer : function(v,x,r) { return String.format('<img src="{0}/Images/Thumb/100/{1}/{2}">', baseURL, v, r.data.filename); }
298 xtype: 'ColumnModel',
302 dataIndex : 'filename',
303 renderer : function(v,x,r) { return String.format('{0}<br/><i qtip="{1}">{1}</i>', v, r.data.linkurl); }
310 xtype: 'LayoutRegion',
315 xtype: 'LayoutRegion',
344 _this.dialog.el.mask("Saving");
346 _this.form.doAction("submit");