[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [14524] modify populateSelect_activityCalendar()
From: |
Saul |
Subject: |
[Fmsystem-commits] [14524] modify populateSelect_activityCalendar() |
Date: |
Fri, 04 Dec 2015 23:42:22 +0000 |
Revision: 14524
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=14524
Author: psaul
Date: 2015-12-04 23:42:21 +0000 (Fri, 04 Dec 2015)
Log Message:
-----------
modify populateSelect_activityCalendar()
Modified Paths:
--------------
branches/dev-syncromind/phpgwapi/js/jquery/common.js
Modified: branches/dev-syncromind/phpgwapi/js/jquery/common.js
===================================================================
--- branches/dev-syncromind/phpgwapi/js/jquery/common.js 2015-12-03
22:06:26 UTC (rev 14523)
+++ branches/dev-syncromind/phpgwapi/js/jquery/common.js 2015-12-04
23:42:21 UTC (rev 14524)
@@ -877,17 +877,25 @@
}
function populateSelect_activityCalendar (url, container, attr) {
+ container.html("");
var select = document.createElement('select');
var option = document.createElement('option');
if (attr){
$.each(attr, function(i, v){
select.setAttribute(v['name'],v['value']);
- })
+ });
}
- $.get(url, function(r){
- select.innerHTML = r;
- container.html("");
- if (r) {
+ option.setAttribute('value', '');
+ option.text = 'Velg gateadresse';
+ $.get(url, function(data){
+ var r = data.ResultSet.Result;
+ $.each(r, function(index, value) {
+ var option = document.createElement('option');
+ option.text = value.name;
+ option.setAttribute('value', value.name);
+ select.appendChild(option);
+ });
+ if (r.length > 0) {
container.append(select);
}
}).fail(function(){
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [14524] modify populateSelect_activityCalendar(),
Saul <=