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());
72 if (action.type == 'setdata') {
74 _this.dialog.el.mask("Loading");
75 this.load({ method: 'GET', params: { '_id' : _this.data.id }});
78 _this.grid.getDataSource().load();
81 if (action.type == 'load') {
82 _this.grid.getDataSource().load();
83 _this.dialog.el.unmask();
90 rendered : function (_self)
96 style : 'margin: 5px',
97 url : baseURL + '/Roo/Category.php',
102 fieldLabel : 'Parent',
103 name : 'parent_id_title',
108 xtype: 'NumberField',
110 decimalPrecision : 2,
111 fieldLabel : 'Order (1 first)',
112 name : 'display_order'
118 fieldLabel : 'Title',
125 displayField : 'name',
127 emptyText : "Select Type",
129 forceSelection : true,
130 hiddenName : 'category_type_id',
132 loadingText : "Searching...",
134 name : 'category_type_id_name',
136 qtip : "Select cms_category_type",
137 selectOnFocus : true,
138 tpl : '<div class="x-grid-cell-text x-btn button"><b>{name}</b> </div>',
139 triggerAction : 'all',
147 sortInfo : { direction : 'ASC', field: 'id' },
149 beforeload : function (_self, o){
150 o.params = o.params || {};
158 url : baseURL + '/Roo/cms_category_type.php'
165 totalProperty : 'total',
166 fields : [{"name":"id","type":"int"},{"name":"name","type":"string"}]
173 fieldLabel : 'Visible',
196 tableName : 'Images',
199 activate : function() {
202 //_this.grid.footer.onClick('first');
210 autoExpandColumn : 'filename',
213 render : function() {
215 //_this.dialog = Pman.Dialog.FILL_IN
216 if (_this.panel.active) {
217 //this.footer.onClick('first');
224 reader : Pman.Readers.Images,
226 beforeload : function (_self, o)
228 if (!_this.data.id) {
231 o.params = o.params || {};
232 o.params.onid = _this.data.id;
233 o.params.ontable = 'Category';
240 url : baseURL + '/Roo/Images.php'
251 cls : 'x-btn-text-icon',
252 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
256 Pman.Dialog.Image.show( { id : 0, onid: _this.data.id, ontable: 'Category' }, function(data) {
257 _this.grid.getDataSource().load();
258 Pman.Dialog.CmsImage.show(data, function() {
259 _this.grid.getDataSource().load();
272 cls : 'x-btn-text-icon',
273 icon : Roo.rootURL + 'images/default/tree/leaf.gif',
277 var s = _this.grid.getSelectionModel().getSelections();
278 if (!s.length || (s.length > 1)) {
279 Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
282 var data = _this.grid.getDataSource().getById(s[0].data.id).data;
283 Pman.Dialog.CmsImage.show(data, function() {
284 _this.grid.getDataSource().load();
294 cls : 'x-btn-text-icon',
295 icon : rootURL + '/Pman/templates/images/trash.gif',
299 Pman.genericDelete(_this, _this.panel.tableName);
307 xtype: 'ColumnModel',
312 renderer : function(v,x,r) { return String.format('<img src="{0}/Images/Thumb/100/{1}/{2}">', baseURL, v, r.data.filename); }
315 xtype: 'ColumnModel',
319 dataIndex : 'filename',
320 renderer : function(v,x,r) { return String.format('{0}<br/><i qtip="{1}">{1}</i>', v, r.data.linkurl); }
327 xtype: 'LayoutRegion',
332 xtype: 'LayoutRegion',
361 _this.dialog.el.mask("Saving");
363 _this.form.doAction("submit");