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)
97 fieldLabel : 'Parent ',
98 name : 'parent_id_title',
99 hiddenName : 'parent_id',
100 qtip : "Select Parent ",
101 emptyText : "Select Parent ",
102 selectOnFocus : true,
107 displayField : 'title',
110 forceSelection : true,
111 triggerAction : 'all',
112 tpl : '<div class="x-grid-cell-text x-btn button"><b>{title}</b> </div>',
113 queryParam : 'query[title]',
114 loadingText : "Searching...",
120 reader : Pman.Readers.Category,
124 url : baseURL + '/Roo/Category.php',
133 fieldLabel : 'Title',
139 fieldLabel : 'Colour',
146 fieldLabel : 'Visible',
158 fieldLabel : 'Page text',
180 tableName : 'Images',
183 activate : function() {
186 //_this.grid.footer.onClick('first');
194 autoExpandColumn : 'filename',
197 render : function() {
199 //_this.dialog = Pman.Dialog.FILL_IN
200 if (_this.panel.active) {
201 //this.footer.onClick('first');
208 reader : Pman.Readers.Images,
210 beforeload : function (_self, o)
212 if (!_this.data.id) {
215 o.params = o.params || {};
216 o.params.onid = _this.data.id;
217 o.params.ontable = 'Category';
224 url : baseURL + '/Roo/Images.php'
235 cls : 'x-btn-text-icon',
236 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
240 Pman.Dialog.Image.show( { id : 0, onid: _this.data.id, ontable: 'Category' }, function(data) {
241 _this.grid.getDataSource().load();
242 Pman.Dialog.CmsImage.show(data, function() {
243 _this.grid.getDataSource().load();
256 cls : 'x-btn-text-icon',
257 icon : Roo.rootURL + 'images/default/tree/leaf.gif',
261 var s = _this.grid.getSelectionModel().getSelections();
262 if (!s.length || (s.length > 1)) {
263 Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
266 var data = _this.grid.getDataSource().getById(s[0].data.id).data;
267 Pman.Dialog.CmsImage.show(data, function() {
268 _this.grid.getDataSource().load();
278 cls : 'x-btn-text-icon',
279 icon : rootURL + '/Pman/templates/images/trash.gif',
283 Pman.genericDelete(_this, _this.panel.tableName);
291 xtype: 'ColumnModel',
296 renderer : function(v,x,r) { return String.format('<img src="{0}/Images/Thumb/100/{1}/{2}">', baseURL, v, r.data.filename); }
299 xtype: 'ColumnModel',
303 dataIndex : 'filename',
304 renderer : function(v,x,r) { return String.format('{0}<br/><i qtip="{1}">{1}</i>', v, r.data.linkurl); }
311 xtype: 'LayoutRegion',
316 xtype: 'LayoutRegion',
345 _this.dialog.el.mask("Saving");
347 _this.form.doAction("submit");