Wednesday, September 27, 2017

The lino_xl.lib.accounting.AccountingReport has a subtle but disturbing problem: since building all the reports can take a second or ten, it is annoying that Lino tries to do it again and again each time I change some parameter value.

A first approach for fixing this might be to have an “explicit refresh button” and to disable the automatic refreshing after each parameter field change.

The refresh button

Currently there is no lino.core.actions.Action object which represents the “Refresh” button.

A Lino.GridPanel has a Ext.PagingToolbar (or Ext.toolbar.Paging in ExtJS 6) as as tbar which has a built-in “refresh” button.

BTW this hard-coded button of the PagingToolbar does not call the refresh() method (which is a Lino concept) but store.load().

The Lino.GridPanel also calls its refresh() automatically after resize and viewready events.

The Lino.FormPanel (defined in linoweb.js) adds the refresh button itself:

this.tbar = this.tbar.concat([
  {
    handler:function(){ this.do_when_clean(false,this.refresh.createDelegate(this)) },
    iconCls: 'x-tbar-loading',
    tooltip:"{{_('Reload current record')}}",
    scope:this}
]);

The Lino.MainPanel.add_params_panel() method adds a listener to the change events of the parameter panel fields.