diff --git a/src/webui/extjs.c b/src/webui/extjs.c index 1012eaa1..f6b33c7c 100644 --- a/src/webui/extjs.c +++ b/src/webui/extjs.c @@ -294,10 +294,10 @@ extjs_tablemgr(http_connection_t *hc, const char *remain, void *opaque) if(in != NULL) htsmsg_destroy(in); - if(out != NULL) { - htsmsg_json_serialize(out, hq, 0); - htsmsg_destroy(out); - } + if(out == NULL) + out = htsmsg_create_map(); + htsmsg_json_serialize(out, hq, 0); + htsmsg_destroy(out); http_output_content(hc, "text/x-json; charset=UTF-8"); return 0; } diff --git a/src/webui/static/app/tableeditor.js b/src/webui/static/app/tableeditor.js index c3a1972d..dc04d1af 100644 --- a/src/webui/static/app/tableeditor.js +++ b/src/webui/static/app/tableeditor.js @@ -13,6 +13,11 @@ tvheadend.tableEditor = function(title, dtable, cm, rec, plugins, store, op : "get" } }); + + tvheadend.comet.on(dtable, function(m){ + if (m.reload) + store.reload(); + }); } function addRecord() { @@ -65,7 +70,6 @@ tvheadend.tableEditor = function(title, dtable, cm, rec, plugins, store, Ext.MessageBox.alert('Server Error', 'Unable to delete'); }, success : function(response, options) { - store.reload(); } }) } @@ -88,6 +92,7 @@ tvheadend.tableEditor = function(title, dtable, cm, rec, plugins, store, entries : Ext.encode(out) }, success : function(response, options) { + // Note: this call is mostly redundant (comet update will pick it up anyway) store.commitChanges(); }, failure : function(response, options) {