开发者

How to call several addOnLoad functions in dojo?

开发者 https://www.devze.com 2023-03-09 14:19 出处:网络
I\'m trying to define several dojo elements from several (inherited) HTML pages , and each defines addOnLoad of his own, which causes only the latest function to be executed, since they are overridden

I'm trying to define several dojo elements from several (inherited) HTML pages , and each defines addOnLoad of his own, which causes only the latest function to be executed, since they are overridden.

Is the开发者_JS百科re a way to overcome this problem?

Thanks.


You can use blocks to replace inherited elements

in template-base:

<head>
  <script type="text/javascript" src=""></script>
  {% block extra-header %} 
    #code default
    ...
  {% endblock %}
</head>

in template:

{% block extra-header %} 
{{ block.super }}
   #replacement code
   ...
   <script type="text/javascript" src=""></script>
{% endblock %}

for more information see https://docs.djangoproject.com/en/1.3/topics/templates/#template-inheritance

0

精彩评论

暂无评论...
验证码 换一张
取 消