Pman.Dialog.CmsBlog.bjs
[Pman.Cms] / Pman.Dialog.CmsCategory.js
index 723cd8e..ee7908f 100644 (file)
@@ -69,10 +69,23 @@ Pman.Dialog.CmsCategory = {
                                         _this.form.reset();
                                         return;
                                     }
-                                    if (action.type = 'setdata') {
+                                     if (action.type == 'setdata') {
+                                         if (_this.data.id) {
+                                           _this.dialog.el.mask("Loading");
+                                           this.load({ method: 'GET', params: { '_id' : _this.data.id }});
+                                            return;
+                                       }
+                                      _this.grid.getDataSource().load();
+                                       return;
+                                    }
+                                    if (action.type == 'load') {
                                        _this.grid.getDataSource().load();
-                                    
+                                        _this.dialog.el.unmask();
+                                        return;
                                     }
+                                    
+                                  
+                                    
                                 },
                                 rendered : function (_self)
                                 {
@@ -91,6 +104,14 @@ Pman.Dialog.CmsCategory = {
                                     readOnly : true,
                                     width : 450
                                 },
+                                {
+                                    xtype: 'NumberField',
+                                    xns: Roo.form,
+                                    decimalPrecision : 0,
+                                    fieldLabel : 'Order (1 first)',
+                                    name : 'display_order',
+                                    width : 50
+                                },
                                 {
                                     xtype: 'TextField',
                                     xns: Roo.form,
@@ -101,26 +122,25 @@ Pman.Dialog.CmsCategory = {
                                 {
                                     xtype: 'ComboBox',
                                     xns: Roo.form,
-                                    allowBlank : 'false',
+                                    allowBlank : true,
                                     displayField : 'name',
                                     editable : 'false',
                                     emptyText : "Select Type",
                                     fieldLabel : 'Type',
                                     forceSelection : true,
                                     hiddenName : 'category_type_id',
-                                    listWidth : 400,
+                                    listWidth : 200,
                                     loadingText : "Searching...",
                                     minChars : 2,
                                     name : 'category_type_id_name',
                                     pageSize : 20,
                                     qtip : "Select cms_category_type",
-                                    queryParam : '',
                                     selectOnFocus : true,
                                     tpl : '<div class="x-grid-cell-text x-btn button"><b>{name}</b> </div>',
                                     triggerAction : 'all',
                                     typeAhead : true,
                                     valueField : 'id',
-                                    width : 300,
+                                    width : 200,
                                     store : {
                                         xtype: 'Store',
                                         xns: Roo.data,
@@ -148,13 +168,6 @@ Pman.Dialog.CmsCategory = {
                                         }
                                     }
                                 },
-                                {
-                                    xtype: 'TextField',
-                                    xns: Roo.form,
-                                    fieldLabel : 'Colour',
-                                    name : 'short_name',
-                                    width : 100
-                                },
                                 {
                                     xtype: 'Checkbox',
                                     xns: Roo.form,
@@ -294,9 +307,9 @@ Pman.Dialog.CmsCategory = {
                             {
                                 xtype: 'ColumnModel',
                                 xns: Roo.grid,
+                                dataIndex : 'id',
                                 header : '',
                                 width : 110,
-                                dataIndex : 'id',
                                 renderer : function(v,x,r) { return String.format('<img src="{0}/Images/Thumb/100/{1}/{2}">', baseURL, v, r.data.filename); }
                             },
                             {