Preloading Planner required scripts.
The required scripts must be loaded when creating the page, if Planner isn't in the first shown tab it would fail when loading
This commit is contained in:
parent
e015c61a09
commit
7923679131
2 changed files with 12 additions and 10 deletions
|
|
@ -49,6 +49,16 @@ import org.zkoss.zul.api.Button;
|
|||
|
||||
public class Planner extends HtmlMacroComponent {
|
||||
|
||||
public static void registerNeededScripts() {
|
||||
IScriptsRegister register = getScriptsRegister();
|
||||
register.register(ScriptsRequiredByPlanner.class);
|
||||
}
|
||||
|
||||
private static IScriptsRegister getScriptsRegister() {
|
||||
return OnZKDesktopRegistry.getLocatorFor(IScriptsRegister.class)
|
||||
.retrieve();
|
||||
}
|
||||
|
||||
private GanttDiagramGraph diagramGraph;
|
||||
|
||||
private LeftPane leftPane;
|
||||
|
|
@ -73,11 +83,6 @@ public class Planner extends HtmlMacroComponent {
|
|||
registerNeededScripts();
|
||||
}
|
||||
|
||||
private void registerNeededScripts() {
|
||||
IScriptsRegister register = getScriptsRegister();
|
||||
register.register(ScriptsRequiredByPlanner.class);
|
||||
}
|
||||
|
||||
TaskList getTaskList() {
|
||||
if (ganttPanel == null) {
|
||||
return null;
|
||||
|
|
@ -281,11 +286,6 @@ public class Planner extends HtmlMacroComponent {
|
|||
getDependencyList().redrawDependencies();
|
||||
}
|
||||
|
||||
private IScriptsRegister getScriptsRegister() {
|
||||
return OnZKDesktopRegistry.getLocatorFor(IScriptsRegister.class)
|
||||
.retrieve();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterCompose() {
|
||||
super.afterCompose();
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.zkoss.ganttz.Planner;
|
||||
import org.zkoss.ganttz.TabSwitcher;
|
||||
import org.zkoss.ganttz.TabsRegistry;
|
||||
import org.zkoss.ganttz.adapters.State;
|
||||
|
|
@ -201,6 +202,7 @@ public class MultipleTabsPlannerController implements Composer,
|
|||
|
||||
@Override
|
||||
public void doAfterCompose(org.zkoss.zk.ui.Component comp) throws Exception {
|
||||
Planner.registerNeededScripts();
|
||||
tabsSwitcher = (TabSwitcher) comp;
|
||||
breadcrumbs = comp.getPage().getFellow("breadcrumbs");
|
||||
tabsSwitcher.setConfiguration(buildTabsConfiguration());
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue