diff --git a/static/scripts/grid_2.js b/static/scripts/grid_2.js index 816078df819c1669f1a73e7f9abede869797713e..d6bb8b1d1576d03f79175df6d5033199bd932878 100755 --- a/static/scripts/grid_2.js +++ b/static/scripts/grid_2.js @@ -1,26 +1,46 @@ /** * grid_2.js * - * To test and debug grid widget + * To test and debug grid widget using MathJax * $Id$ * */ Ext.namespace('App.grid'); /** - * main function + * main function to get configuration information */ +mainCfg = function(){ -var main = function(provider, response){ + // Expose the remote service cfgSvc + Ext.Direct.addProvider(App.cfgSvcMethods); + + // Request form model from the server + cfgSvc.getGridModel('publications', mainGrid); + +}; + +/** + * main function to instanciate the grid + * @param {Object} provider + * @param {Object} response + */ +mainGrid = function(provider, response){ var cfg = response.result; // console.log("Grid Model"); // console.dir(cfg); - // instanciate the grid + // instenciate the grid var grid = new App.grid.Grid(cfg); + grid.getView().on('refresh', function(){ + console.debug('onRefresh'); + MathJax.Hub.PreProcess(); + MathJax.Hub.Process(); + }) + // the viewport to hold the grid // using all space available in the browser var vp = new Ext.Viewport({ @@ -37,10 +57,7 @@ Ext.onReady(function(){ Ext.QuickTips.init(); - // Expose the remote service cfgSvc - Ext.Direct.addProvider(App.cfgSvcMethods); - - // Request form model from the server - cfgSvc.getGridModel('publications', main) + // load the MathJax librayri + App.withMathJax ? App.loadMathJax(mainCfg) : mainCfg(); }); \ No newline at end of file