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)
89 fieldLabel : 'Parent ',
90 name : 'parent_id_title',
91 hiddenName : 'parent_id',
92 qtip : "Select Parent ",
93 emptyText : "Select Parent ",
99 displayField : 'title',
102 forceSelection : true,
103 triggerAction : 'all',
104 tpl : '<div class="x-grid-cell-text x-btn button"><b>{title}</b> </div>',
105 queryParam : 'query[title]',
106 loadingText : "Searching...",
112 reader : Pman.Readers.Category,
116 url : baseURL + '/Roo/Category.php',
125 fieldLabel : 'Title',
131 fieldLabel : 'Colour',
138 fieldLabel : 'Visible',
150 fieldLabel : 'Page text',
172 tableName : 'Images',
175 activate : function() {
178 //_this.grid.footer.onClick('first');
186 autoExpandColumn : 'filename',
189 render : function() {
191 //_this.dialog = Pman.Dialog.FILL_IN
192 if (_this.panel.active) {
193 //this.footer.onClick('first');
200 reader : Pman.Readers.Images,
202 beforeload : function (_self, o)
204 if (!_this.data.id) {
207 o.params = o.params || {};
208 o.params.onid = _this.data.id;
209 o.params.ontable = 'Category';
216 url : baseURL + '/Roo/Images.php'
227 cls : 'x-btn-text-icon',
228 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
232 Pman.Dialog.Image.show( { id : 0, onid: _this.data.id, ontable: 'Category' }, function(data) {
233 _this.grid.getDataSource().load();
234 Pman.Dialog.CmsImage.show(data, function() {
235 _this.grid.getDataSource().load();
248 cls : 'x-btn-text-icon',
249 icon : Roo.rootURL + 'images/default/tree/leaf.gif',
253 var s = _this.grid.getSelectionModel().getSelections();
254 if (!s.length || (s.length > 1)) {
255 Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
258 var data = _this.grid.getDataSource().getById(s[0].data.id).data;
259 Pman.Dialog.CmsImage.show(data, function() {
260 _this.grid.getDataSource().load();
270 cls : 'x-btn-text-icon',
271 icon : rootURL + '/Pman/templates/images/trash.gif',
275 Pman.genericDelete(_this, _this.panel.tableName);
283 xtype: 'ColumnModel',
288 renderer : function(v,x,r) { return String.format('<img src="{0}/Images/Thumb/100/{1}/{2}">', baseURL, v, r.data.filename); }
291 xtype: 'ColumnModel',
295 dataIndex : 'filename',
296 renderer : function(v,x,r) { return String.format('{0}<br/><i qtip="{1}">{1}</i>', v, r.data.linkurl); }
303 xtype: 'LayoutRegion',
308 xtype: 'LayoutRegion',
337 _this.dialog.el.mask("Saving");
339 _this.form.doAction("submit");