Pman.Dialog.AdminCoreEnum.bjs
authorAlan Knowles <alan@roojs.com>
Mon, 6 Jun 2016 08:33:45 +0000 (16:33 +0800)
committerAlan Knowles <alan@roojs.com>
Mon, 6 Jun 2016 08:33:45 +0000 (16:33 +0800)
Pman.Dialog.AdminCoreEnum.js

Pman.Dialog.AdminCoreEnum.bjs
Pman.Dialog.AdminCoreEnum.js

index f82d601..26ba11c 100644 (file)
@@ -24,8 +24,8 @@
     "show" : "function (_self)\n{\n    if(!isAdmin && Pman.Tab.Hopedb){\n        Roo.MessageBox.alert(\"Error\", \"Permission Denied\", function(){\n            _this.dialog.hide();\n        });\n        return;\n    }\n    var name_hidden = false;\n\n    if (typeof(_this.data._hide_name) != 'undefined') {\n        name_hidden = true;\n    \n    }\n    \n  _this.grid.colModel.setHidden(1,name_hidden);\n    _this.grid.footer.onClick('first');\n    \n}"
    },
    "modal" : true,
-   "title" : "Pulldown Options",
    "xtype" : "LayoutDialog",
+   "title" : "Pulldown Options",
    "width" : 950,
    "$ xns" : "Roo",
    "closable" : false,
@@ -41,9 +41,9 @@
      "listeners" : {
       "|activate" : "function() {\n    _this.panel = this;\n    if (_this.grid) {\n     //   _this.grid.footer.onClick('first');\n    }\n    \n}"
      },
+     "background" : false,
      "region" : "center",
      "fitToframe" : true,
-     "background" : false,
      "title" : "Pulldown Options",
      "xtype" : "GridPanel",
      "fitContainer" : true,
@@ -53,8 +53,8 @@
       {
        "listeners" : {
         "beforeedit" : "function (e)\n{\n  \n    // force fill in of name first.. (Except when it's hidden)\n    if (typeof(_this.data._hide_name) != 'undefined') { \n        if(e.field == 'display_name' && e.record.data.is_system_enum*1 == 1){\n            return ;\n        }\n \n    }\n    \n    if(e.field == 'name' && e.record.data.is_system_enum*1 == 1){\n        Roo.log(\"block name?\");\n        return false;\n    }\n}",
-        "cellclick" : "function (_self, rowIndex, columnIndex, e)\n{\n\n        var di = this.colModel.getDataIndex(columnIndex);\n        if (di != 'active') {\n            return;\n        }\n         \n        var rec = _this.grid.ds.getAt(rowIndex);\n        \n        rec.set('active', rec.data.active ? 0 : 1);\n        rec.commit();\n         \n        \n}",
         "|render" : "function() \n{\n    _this.grid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    if (_this.panel.active) {\n   //    this.footer.onClick('first');\n    }\n}",
+        "cellclick" : "function (_self, rowIndex, columnIndex, e)\n{\n\n        var di = this.colModel.getDataIndex(columnIndex);\n        if (di != 'active') {\n            return;\n        }\n         \n        var rec = _this.grid.ds.getAt(rowIndex);\n        \n        rec.set('active', rec.data.active ? 0 : 1);\n        rec.commit();\n         \n        \n}",
         "afteredit" : "function (e)\n{\n   e.record.commit();   \n}"
        },
        "autoExpandColumn" : "display_name",
@@ -67,7 +67,7 @@
         {
          "listeners" : {
           "update" : "function (_self, record, operation)\n{\n    if (operation != Roo.data.Record.COMMIT) {\n        return;\n    }\n    Roo.log(record);\n\n    if (typeof(_this.data._hide_name) != 'undefined') {\n        record.set('name', record.data.display_name);\n    }\n    if (!record.data.name.length) {\n        return;\n    }\n    \n    // got commit..\n    new Pman.Request({\n        url : baseURL + '/Roo/Core_enum.php',\n        method : 'POST',\n        params : {\n            id : record.data.id,\n            etype : _this.data.etype,\n            name :  record.data.name,\n            active : record.data.active,\n            seqid : record.data.seqid,\n            display_name : record.data.display_name\n        }, \n        success : function(res) {\n            //Roo.log(data);\n            // update the ID if it's not set..\n            if (record.data.id * 1 < 1) {\n                record.set('id', res.data.id);\n            }\n        }\n    });\n    \n}",
-          "beforeload" : "function (_self, options)\n{\n\n    options.params.etype = _this.data.etype;\n    if (!options.params.etype.length) {\n        return false;\n    }\n    \n}"
+          "beforeload" : "function (_self, options)\n{\n\n    options.params.etype = _this.data.etype;\n    if (!options.params.etype.length) {\n        return false;\n    }\n    \n    \n    \n    \n}"
          },
          "xtype" : "Store",
          "remoteSort" : true,
@@ -77,8 +77,8 @@
          "items" : [
           {
            "$ url" : "baseURL + '/Roo/core_enum.php'",
-           "xtype" : "HttpProxy",
            "method" : "GET",
+           "xtype" : "HttpProxy",
            "$ xns" : "Roo.data",
            "* prop" : "proxy"
           },
         },
         {
          "xtype" : "ColumnModel",
-         "header" : "Internal #",
          "width" : 75,
+         "header" : "Internal #",
          "$ renderer" : "function(v) { return String.format('{0}', v); }",
          "$ xns" : "Roo.grid",
          "* prop" : "colModel[]",
         },
         {
          "xtype" : "ColumnModel",
-         "width" : 200,
          "header" : "Name",
+         "width" : 200,
          "$ renderer" : "function(v) { return String.format('{0}', v); }",
          "$ xns" : "Roo.grid",
          "* prop" : "colModel[]",
         },
         {
          "xtype" : "ColumnModel",
-         "header" : "Display Name",
          "width" : 200,
+         "header" : "Display Name",
          "$ renderer" : "function(v) { return String.format('{0}', v); }",
          "$ xns" : "Roo.grid",
          "* prop" : "colModel[]",
         },
         {
          "xtype" : "ColumnModel",
-         "header" : "Active",
          "width" : 75,
+         "header" : "Active",
          "$ renderer" : "function(v) {  \n    var state = v> 0 ?  '-checked' : '';\n\n    return '<img class=\"x-grid-check-icon' + state + '\" src=\"' + Roo.BLANK_IMAGE_URL + '\"/>';\n                \n }",
          "$ xns" : "Roo.grid",
          "* prop" : "colModel[]",
index b354969..23762ff 100644 (file)
@@ -259,6 +259,9 @@ Pman.Dialog.AdminCoreEnum = {
                   return false;
               }
               
+              
+              
+              
           },
          update : function (_self, record, operation)
           {