sync
[Pman.Admin] / Pman.Dialog.AdminLanguagePick.bjs
1 {
2  "name" : "Pman.Dialog.AdminLanguagePick",
3  "parent" : "",
4  "title" : "",
5  "path" : "/home/alan/gitlive/Pman.Admin/Pman.Dialog.AdminLanguagePick.bjs",
6  "permname" : "",
7  "modOrder" : "001",
8  "strings" : {
9   "4994a8ffeba4ac3140beb89e8d41f174" : "Language",
10   "ea4788705e6873b424c65e91c2846b19" : "Cancel",
11   "052ca52fc8eb1bdff3e34de3fa735e35" : "Select a Language",
12   "e0aa021e21dddbd6d8cecec71e9cf564" : "OK"
13  },
14  "named_strings" : {
15   "language_name_fieldLabel" : "4994a8ffeba4ac3140beb89e8d41f174"
16  },
17  "items" : [
18   {
19    "modal" : true,
20    "collapsible" : false,
21    "title" : "Select a Language",
22    "xtype" : "LayoutDialog",
23    "width" : 400,
24    "$ xns" : "Roo",
25    "closable" : false,
26    "resizable" : false,
27    "height" : 120,
28    "items" : [
29     {
30      "xtype" : "LayoutRegion",
31      "$ xns" : "Roo",
32      "* prop" : "center"
33     },
34     {
35      "region" : "center",
36      "xtype" : "ContentPanel",
37      "$ xns" : "Roo",
38      "items" : [
39       {
40        "listeners" : {
41         "|actioncomplete" : "function(_self,action)\n{\n    if (action.type == 'setdata') {\n       //_this.dialog.el.mask(\"Loading\");\n       //this.load({ method: 'GET', params: { '_id' : _this.data.id }});\n       return;\n    }\n    if (action.type == 'load') {\n        _this.dialog.el.unmask();\n        return;\n    }\n    if (action.type =='submit') {\n    \n        _this.dialog.el.unmask();\n        _this.dialog.hide();\n\n         if (_this.callback) {\n            _this.callback.call(_this, _this.form.getValues());\n         }\n         _this.form.reset();\n         return;\n    }\n}\n",
42         "|rendered" : "function (form)\n{\n    _this.form= form;\n}\n"
43        },
44        "$ url" : "baseURL + '/Roo/INGORE.php'",
45        "method" : "GET",
46        "xtype" : "Form",
47        "style" : "margin:10px;",
48        "$ xns" : "Roo.form",
49        "items" : [
50         {
51          "alwaysQuery" : true,
52          "listWidth" : 200,
53          "triggerAction" : "all",
54          "fieldLabel" : "Language",
55          "displayField" : "title",
56          "hiddenName" : "lang",
57          "valueField" : "code",
58          "xtype" : "ComboBox",
59          "allowBlank" : false,
60          "editable" : false,
61          "width" : 200,
62          "$ xns" : "Roo.form",
63          "name" : "language_name",
64          "items" : [
65           {
66            "listeners" : {
67             "beforeload" : "function (_self, o)\n{\n   //  o.params['!code'] = 'en'; // exclude english from the list (it's the default?)\n}"
68            },
69            "xtype" : "Store",
70            "$ xns" : "Roo.data",
71            "* prop" : "store",
72            "items" : [
73             {
74              "$ url" : "baseURL + '/Core/I18n/Lang'",
75              "method" : "GET",
76              "xtype" : "HttpProxy",
77              "$ xns" : "Roo.data",
78              "* prop" : "proxy"
79             },
80             {
81              "id" : "code",
82              "root" : "data",
83              "xtype" : "JsonReader",
84              "$ fields" : "[\n    {\n        'name': 'code',\n        'type': 'string'\n    },\n    {\n        'name': 'title',\n        'type': 'string'\n    }\n]",
85              "$ xns" : "Roo.data",
86              "* prop" : "reader",
87              "totalProperty" : "total"
88             }
89            ]
90           }
91          ]
92         }
93        ]
94       }
95      ]
96     },
97     {
98      "listeners" : {
99       "click" : "function (_self, e)\n{\n    _this.dialog.hide();\n}"
100      },
101      "text" : "Cancel",
102      "xtype" : "Button",
103      "$ xns" : "Roo",
104      "* prop" : "buttons[]"
105     },
106     {
107      "listeners" : {
108       "click" : "function (_self, e)\n{\n    // do some checks?\n     \n    var data =  _this.form.getValues();\n \n    if (!data.lang.length) {\n    \n        Roo.MessageBox.alert(\"Error\", \"Select language\");\n        return;\n    \n    }\n    _this.dialog.hide();\n            \n    var callbackData = data.lang;\n   // Roo.log(_this.data);\n    if(_this.data._with_name == true){\n        callbackData = {'lang' : data.lang , 'lang_name' : _this.form.findField('lang').lastSelectionText};\n    }\n    \n    _this.callback(callbackData);\n    \n\n}"
109      },
110      "text" : "OK",
111      "xtype" : "Button",
112      "$ xns" : "Roo",
113      "* prop" : "buttons[]"
114     }
115    ]
116   }
117  ]
118 }