{
"listeners": {
"beforeload": "function (_self, o){\n o.params = o.params || {};\n\n}\n",
- "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.client_id.length || !record.data.client_secret.length) {\n return;\n }\n \n new Pman.Request({\n url : baseURL + '/Roo/Core_oauth_clients.php',\n method : 'POST',\n params : record.data,\n success : function(res) {\n _this.gird.footer.onClick('refresh');\n }\n });\n \n}"
+ "update": "function (_self, record, operation)\n{\n if (operation != Roo.data.Record.COMMIT) {\n return;\n }\n\n if (!record.data.client_id.length || !record.data.client_secret.length) {\n return;\n }\n \n new Pman.Request({\n url : baseURL + '/Roo/Core_oauth_clients',\n method : 'POST',\n params : {\n id : record.data.id,\n client_id : record.data.client_id,\n client_secret : record.data.client_secret,\n redirect_uri : record.data.redirect_uri\n },\n success : function(res) {\n _this.grid.footer.onClick('refresh');\n }\n });\n \n}"
},
"*prop": "dataSource",
"remoteSort": true,
"root": "data",
"totalProperty": "total",
"xtype": "JsonReader",
- "|fields": "[\n {\n 'name': 'client_id',\n 'type': 'string'\n },\n {\n 'name': 'client_secret',\n 'type': 'string'\n },\n {\n 'name': 'redirect_uri',\n 'type': 'string'\n }\n]",
+ "|fields": "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'client_id',\n 'type': 'string'\n },\n {\n 'name': 'client_secret',\n 'type': 'string'\n },\n {\n 'name': 'redirect_uri',\n 'type': 'string'\n }\n]",
"|xns": "Roo.data"
}
]
"items": [
{
"listeners": {
- "|click": "function()\n{\n \n var nr = _this.grid.ds.reader.newRow({\n client_id : '',\n client_secret : '',\n redirect_uri : ''\n });\n \n _this.grid.stopEditing();\n _this.grid.ds.insert(_this.grid.ds.getCount(), nr); \n _this.grid.startEditing(_this.grid.ds.getCount()-1, 1);\n}\n"
+ "|click": "function()\n{\n \n var nr = _this.grid.ds.reader.newRow({\n id : 0,\n client_id : '',\n client_secret : '',\n redirect_uri : ''\n });\n \n _this.grid.stopEditing();\n _this.grid.ds.insert(_this.grid.ds.getCount(), nr); \n _this.grid.startEditing(_this.grid.ds.getCount()-1, 0);\n}\n"
},
"cls": "x-btn-text-icon",
"text": "Add",
},
{
"listeners": {
- "|click": "function ()\n{ \n var cs = _this.grid.getSelectionModel().getSelectedCell();\n if (!cs) {\n Roo.MessageBox.alert(\"Error\", \"Select a cell\");\n return;\n }\n _this.grid.stopEditing();\n \n var r = _this.grid.ds.getAt(cs[0]);\n \n _this.grid.ds.remove(r);\n \n}"
+ "|click": "function ()\n{ \n var cs = _this.grid.getSelectionModel().getSelectedCell();\n if (!cs) {\n Roo.MessageBox.alert(\"Error\", \"Select a cell\");\n return;\n }\n _this.grid.stopEditing();\n \n var r = _this.grid.ds.getAt(cs[0]);\n \n Roo.MessageBox.confirm(\"Confirm\", \"Are you sure you want to delete this client?\", function (v){\n if (v != 'yes') {\n return;\n }\n \n new Pman.Request({\n url : baseURL + '/Roo/Core_oauth_clients',\n method : 'POST',\n params : {\n _delete : r.data.id\n },\n success : function(res) {\n _this.grid.footer.onClick('refresh');\n }\n });\n });\n}"
},
"cls": "x-btn-text-icon",
"text": "Remove",