Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I get TypeError: 'undefined' is not a function (evalua ….) #28

Open
dpeinado opened this issue Nov 15, 2013 · 2 comments
Open

I get TypeError: 'undefined' is not a function (evalua ….) #28

dpeinado opened this issue Nov 15, 2013 · 2 comments

Comments

@dpeinado
Copy link

Hello, thanks a lot for providing this kind of widget. I'm having a problem using this widget. I see the widget in the page with the icon. I push the icon and nothing occurs. I see in the debugger this error:
TypeError: 'undefined' is not a function (evaluating '$("#f4f0d394302e4843a2f0863dd7c428ee").datetimepicker')
global code (39, line 144)

I've tried to follow closely the example, but I do not know where the problem is.
In the base template I have:

<link href="{% static 'css/bootstrap.min.css' %}" rel="stylesheet" media="screen">
<link href="{% static 'css/bootstrap-responsive.min.css' %}" rel="stylesheet">
 <!-- This file store project specific CSS -->
<link href="{% static 'css/project.css' %}" rel="stylesheet">
<!-- Use this to quickly test CSS changes in a template,
    then move to project.css -->
{% block extra_css %}{% endblock extra_css %}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>  
<script src="{% static 'js/jquery.ui.datepicker.js' %}"></script>
<script src="{% static 'js/bootstrap.min.js' %}"></script>

{{ form.media }}

Then in the template where these widgets are I have:

{% csrf_token %} {{ formset.management_form }} {% for miform in formset %} {{ miform.id}} {% if miform.instance.indicador.esIntervalo %} {{ miform.instance.indicador.nombre }}: {% else %} {% endif %} {% endfor %}
{{ miform.instance.indicador.nombre }}: Inicio Intervalo{{ miform.fecha1 }}Fin Intervalo{{miform.fecha2}} {{ miform.numero }} de {{ miform.total}}{{ miform.instance.indicador.nombre }}: {{ miform.valor|center:'4' }} {{miform.instance.indicador.unidad}}

The form for the formset is:

class InsIndicForm(forms.ModelForm):
#valor = forms.FloatField(widget=forms.TextInput(attrs={'size':'5'}))
class Meta:
model=InstanciaIndicador
fields=('valor','fecha1','fecha2','numero', 'total')
widgets = {
'fecha1': DateTimeWidget(attrs={'id':"fecha1"}, usel10n = True),
'fecha2': DateTimeWidget(attrs={'id':"fecha2"}, usel10n = True),

    }

Please, do you see where is the error?

Thanks in advance,

Diego.

@kleinlieu
Copy link
Contributor

Hey Diego, looks like jQuery may not be defined. I haven't tried this solution yet, but you could try looking at the following link for a proposed solution: #61

@bartmika
Copy link

bartmika commented May 7, 2015

+1 Same problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants