diff --git a/static/plugin_dbui/src/grid/plugin/MathJax.js b/static/plugin_dbui/src/grid/plugin/MathJax.js index 6324713d247a71aeb3cf0291b58261315c5a9ee3..f1488e7e96d7d92d4cc2b1cbdaf02c1f386ad61a 100644 --- a/static/plugin_dbui/src/grid/plugin/MathJax.js +++ b/static/plugin_dbui/src/grid/plugin/MathJax.js @@ -24,8 +24,10 @@ Ext.define('App.grid.plugin.MathJax', { this.setCmp(grid); + // process latex formula each time the grid is refreshed + // NOTE: Mathajax processing is lost when the gridView is + // modified (sort, filter, add, remove or delete). grid.getView().on('refresh', this.onProcessMath, this); - grid.getStore().on('write', this.onProcessMath, this); }, /** @@ -35,10 +37,7 @@ Ext.define('App.grid.plugin.MathJax', { "use strict"; - var grid = this.getCmp(); - - grid.getView().un('refresh', this.onProcessMath, this); - grid.getStore().un('write', this.onProcessMath, this); + this.getCmp().getView().un('refresh', this.onProcessMath, this); }, /**