Changeset ee47845 in observatorio


Ignore:
Timestamp:
Jul 22, 2014, 4:27:21 PM (10 years ago)
Author:
Ing. Roldan Vargas <rvargas@…>
Branches:
master
Children:
df7849d
Parents:
173ef2d
Message:

eliminación de funciones dajax ya no implementadas en el sistema

File:
1 edited

Legend:

Unmodified
Added
Removed
  • procesos/apps/sigesic/busqueda/ajax.py

    r7c9f979 ree47845  
    11# -*- coding: utf-8 -*-
    2 from dajax.core import Dajax
    3 from comun.models import *
    4 from django.utils.encoding import *
    5 from django.utils.safestring import SafeUnicode
    6 from busqueda.forms import FormularioIdentificacion,FormularioUbicacionEmpresa
    7 
    8 def assign_test(request):
    9         dajax = Dajax()
    10         dajax.alert(request.POST['a'])
    11         return dajax
    12 
    13 
    14 def updatecomboM(request):
    15         dajax = Dajax()
    16         cod = str(request.POST['option'])
    17         dajax.alert("entro")
    18        
    19         options = Municipio.objects.filter(entidad = cod).order_by("nombre")
    20         out = "<option value='0'>Seleccione...</option>"
    21         if cod != "0":
    22                 for o in options:
    23                         out = "%s<option value=%s>%s</option>" % (out,o.codigo.encode('utf-8'),o.nombre.encode('utf-8'))
    24                        
    25                 dajax.script("document.getElementById('id_municipio').disabled = false")
    26                 dajax.script("document.getElementById('id_parroquia').value = '0'")
    27                 dajax.script("document.getElementById('id_parroquia').disabled = true")
    28                 dajax.assign('#id_municipio','innerHTML',out)
    29                
    30         else:
    31                 dajax.script("document.getElementById('id_municipio').value = '0'")
    32                 dajax.script("document.getElementById('id_municipio').disabled = true")
    33                 dajax.script("document.getElementById('id_parroquia').value = '0'")
    34                 dajax.script("document.getElementById('id_parroquia').disabled = true")
    35        
    36         return dajax
    37 
    38 def updatecomboP(request):
    39         dajax = Dajax()
    40         cod = str(request.POST['option'])
    41         options = Parroquia.objects.filter(municipio = cod).order_by("nombre")
    42         out = "<option value='0'>Seleccione...</option>"
    43         if cod != "0":
    44                 for o in options:
    45                         out = "%s<option value=%s>%s</option>" % (out,o.codigo.encode('utf-8'),o.nombre.encode('utf-8'))
    46                        
    47                 dajax.script("document.getElementById('id_parroquia').disabled = false")
    48                 dajax.assign('#id_parroquia','innerHTML',out)
    49                
    50         else:
    51                 dajax.script("document.getElementById('id_parroquia').value = '0'")
    52                 dajax.script("document.getElementById('id_parroquia').disabled = true")
    53        
    54         return dajax
    55 
    56 
Note: See TracChangeset for help on using the changeset viewer.