andrea.nieves7 2 years ago
parent
commit
673aa84b96
1 changed files with 52 additions and 4 deletions
  1. 52
    4
      App.js

+ 52
- 4
App.js View File

64
 const queryEnd = "&in=state:72"
64
 const queryEnd = "&in=state:72"
65
 var table = ""
65
 var table = ""
66
 var pueblo = ""
66
 var pueblo = ""
67
+var year = ""
67
 
68
 
68
 
69
 
69
 function updateTable(value){
70
 function updateTable(value){
74
 	pueblo = value
75
 	pueblo = value
75
 }
76
 }
76
 
77
 
78
+function updateYear(value) {
79
+	year = value
80
+}
81
+
77
 //calls data query
82
 //calls data query
78
 function loadDoc(query) {
83
 function loadDoc(query) {
79
   var xhttp = new XMLHttpRequest();
84
   var xhttp = new XMLHttpRequest();
341
 	{label: 'Yauco', value: '153'}
346
 	{label: 'Yauco', value: '153'}
342
   ]);
347
   ]);
343
   
348
   
349
+  
350
+  const [openYear, setOpenYear] = useState(false);
351
+  const [valueYear, setValueYear] = useState(null);
352
+  const [year, setYear] = useState([
353
+    {label:'2000', value: '2000'},
354
+    {label:'2001', value: '2001'},
355
+	{label:'2002', value: '2002'},
356
+    {label:'2003', value: '2003'},
357
+	{label:'2004', value: '2004'},
358
+    {label:'2005', value: '2005'},
359
+	{label:'2006', value: '2006'},
360
+    {label:'2007', value: '2007'},
361
+	{label:'2008', value: '2008'},
362
+    {label:'2009', value: '2009'},
363
+	{label:'2010', value: '2010'},
364
+    {label:'2011', value: '2011'},
365
+	{label:'2012', value: '2012'},
366
+    {label:'2013', value: '2013'},
367
+	{label:'2014', value: '2014'},
368
+    {label:'2015', value: '2015'},
369
+	{label:'2016', value: '2016'},
370
+    {label:'2017', value: '2017'},
371
+	{label:'2018', value: '2018'},
372
+    {label:'2019', value: '2019'},
373
+	{label:'2020', value: '2020'}
374
+  ]);
375
+  
344
 
376
 
345
   return (
377
   return (
346
   <View>
378
   <View>
354
 	  onChangeValue = {(valueTable) => {
386
 	  onChangeValue = {(valueTable) => {
355
 		updateTable(valueTable);
387
 		updateTable(valueTable);
356
 		}}
388
 		}}
357
-	  onOpen = {() => {setOpenPueblo(false)}}
389
+	  onOpen = {() => {setOpenPueblo(false);setOpenYear(false)}}
358
 	  zIndex={3000}
390
 	  zIndex={3000}
359
 	  zIndexInverse={1000}
391
 	  zIndexInverse={1000}
360
 	  placeholder="Tabla de Datos"
392
 	  placeholder="Tabla de Datos"
371
 	  onChangeValue = {(valuePueblo) => {
403
 	  onChangeValue = {(valuePueblo) => {
372
 		updatePueblo(valuePueblo);
404
 		updatePueblo(valuePueblo);
373
 		}}
405
 		}}
374
-	  onOpen = {() => {setOpenTable(false)}}
375
-	  zIndex={1000}
376
-      zIndexInverse={3000}
406
+	  onOpen = {() => {setOpenTable(false);setOpenYear(false)}}
407
+	  zIndex={2000}
408
+      zIndexInverse={2000}
377
 	  placeholder="Pueblo"
409
 	  placeholder="Pueblo"
378
 	  searchPlaceholder="Busqueda..."
410
 	  searchPlaceholder="Busqueda..."
379
     />
411
     />
380
 	
412
 	
413
+	 <DropDownPicker
414
+      open={openYear}
415
+      value={valueYear}
416
+      items={year}
417
+      setOpen={setOpenYear}
418
+      setValue={setValueYear}
419
+      setItems={setYear}
420
+	  onChangeValue = {(valueYear) => {
421
+		updateYear(valueYear);
422
+		}}
423
+	  onOpen = {() => {setOpenPueblo(false);setOpenTable(false)}}
424
+	  zIndex={1000}
425
+	  zIndexInverse={3000}
426
+	  placeholder="20xx"
427
+    />
428
+	
381
 	</View>
429
 	</View>
382
   );
430
   );
383
 }
431
 }