Pman.Dialog.CmsLanguagePick.bjs
authorAlan Knowles <alan@roojs.com>
Wed, 12 Jul 2017 02:34:10 +0000 (10:34 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 12 Jul 2017 02:34:10 +0000 (10:34 +0800)
Pman.Dialog.CmsLanguagePick.js

Pman.Dialog.CmsLanguagePick.bjs
Pman.Dialog.CmsLanguagePick.js

index 9c3352c..9657331 100644 (file)
@@ -2,7 +2,7 @@
  "name" : "Pman.Dialog.CmsLanguagePick",
  "parent" : "",
  "title" : "",
- "path" : "/home/edward/gitlive/Pman.Cms/Pman.Dialog.CmsLanguagePick.bjs",
+ "path" : "/home/alan/gitlive/Pman.Cms/Pman.Dialog.CmsLanguagePick.bjs",
  "permname" : "",
  "modOrder" : "001",
  "strings" : {
@@ -39,8 +39,8 @@
         "|rendered" : "function (form)\n{\n    _this.form= form;\n}\n"
        },
        "$ url" : "baseURL + '/Roo/INGORE.php'",
-       "xtype" : "Form",
        "method" : "GET",
+       "xtype" : "Form",
        "style" : "margin:10px;",
        "$ xns" : "Roo.form",
        "items" : [
          "name" : "language_name",
          "items" : [
           {
+           "listeners" : {
+            "beforeload" : "function (_self, o)\n{\n    o.params['!code'] = 'en'; // exclude english from the list (it's the default?)\n}"
+           },
            "xtype" : "Store",
            "$ xns" : "Roo.data",
            "* prop" : "store",
            "items" : [
             {
              "$ url" : "baseURL + '/Core/I18n/Lang'",
-             "xtype" : "HttpProxy",
              "method" : "GET",
+             "xtype" : "HttpProxy",
              "$ xns" : "Roo.data",
              "* prop" : "proxy"
             },
index ecbaab4..d6bf155 100644 (file)
@@ -37,6 +37,7 @@ Pman.Dialog.CmsLanguagePick = {
  {
    var _this = this;
    this.dialog = Roo.factory({
+    xtype : 'LayoutDialog',
     closable : false,
     collapsible : false,
     height : 120,
@@ -46,30 +47,27 @@ Pman.Dialog.CmsLanguagePick = {
     width : 400,
     xns : Roo,
     '|xns' : 'Roo',
-    xtype : 'LayoutDialog',
     center : {
+     xtype : 'LayoutRegion',
      xns : Roo,
-     '|xns' : 'Roo',
-     xtype : 'LayoutRegion'
+     '|xns' : 'Roo'
     },
     buttons : [
      {
-      text : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
-      xns : Roo,
-      '|xns' : 'Roo',
       xtype : 'Button',
+      text : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
       listeners : {
        click : function (_self, e)
         {
             _this.dialog.hide();
         }
-      }
+      },
+      xns : Roo,
+      '|xns' : 'Roo'
      },
      {
-      text : _this._strings['e0aa021e21dddbd6d8cecec71e9cf564'] /* OK */,
-      xns : Roo,
-      '|xns' : 'Roo',
       xtype : 'Button',
+      text : _this._strings['e0aa021e21dddbd6d8cecec71e9cf564'] /* OK */,
       listeners : {
        click : function (_self, e)
         {
@@ -95,23 +93,23 @@ Pman.Dialog.CmsLanguagePick = {
             
         
         }
-      }
+      },
+      xns : Roo,
+      '|xns' : 'Roo'
      }
     ],
     items  : [
      {
+      xtype : 'ContentPanel',
       region : 'center',
       xns : Roo,
       '|xns' : 'Roo',
-      xtype : 'ContentPanel',
       items  : [
        {
+        xtype : 'Form',
         method : 'GET',
         style : 'margin:10px;',
         url : baseURL + '/Roo/INGORE.php',
-        xns : Roo.form,
-        '|xns' : 'Roo.form',
-        xtype : 'Form',
         listeners : {
          actioncomplete : function(_self,action)
           {
@@ -141,8 +139,11 @@ Pman.Dialog.CmsLanguagePick = {
               _this.form= form;
           }
         },
+        xns : Roo.form,
+        '|xns' : 'Roo.form',
         items  : [
          {
+          xtype : 'ComboBox',
           allowBlank : false,
           alwaysQuery : true,
           displayField : 'title',
@@ -156,19 +157,25 @@ Pman.Dialog.CmsLanguagePick = {
           width : 200,
           xns : Roo.form,
           '|xns' : 'Roo.form',
-          xtype : 'ComboBox',
           store : {
+           xtype : 'Store',
+           listeners : {
+            beforeload : function (_self, o)
+             {
+                 o.params['!code'] = 'en'; // exclude english from the list (it's the default?)
+             }
+           },
            xns : Roo.data,
            '|xns' : 'Roo.data',
-           xtype : 'Store',
            proxy : {
+            xtype : 'HttpProxy',
             method : 'GET',
             url : baseURL + '/Core/I18n/Lang',
             xns : Roo.data,
-            '|xns' : 'Roo.data',
-            xtype : 'HttpProxy'
+            '|xns' : 'Roo.data'
            },
            reader : {
+            xtype : 'JsonReader',
             fields : [
                 {
                     'name': 'code',
@@ -183,8 +190,7 @@ Pman.Dialog.CmsLanguagePick = {
             root : 'data',
             totalProperty : 'total',
             xns : Roo.data,
-            '|xns' : 'Roo.data',
-            xtype : 'JsonReader'
+            '|xns' : 'Roo.data'
            }
           }
          }