I'm currently building a project at work, requiring me pulling in an array of objects, and pinning them on a map.
I'm storing my markers in an array, so that I can reset the map when a user searches for different criteria.
This was all working perfectly until I included Smart Client
.
I'm not very familiar with Smart Client
, but it seems to be adding an Array
class object to my array, thus breaking my for loop.
var wrap = (function() {
var arr;
function myFunc(a) {
for (var i in arr)
arr[i] = null; //doing this to set all markers to null
}
arr = [];
for (var i in a) {
arr.push(a[i]);
}
}
return {
doSomething: function(a) { myFunc(a); }
}
})();
wrap.doSomething([1,2,3,4]);
wrap.doSomething([1,2,3,4]);
This gives me a TypeError: undefined is not a function
error.
smartclient library, smart gwt. I have included the following files.
<script>var isomorphicDir = "/smartclient/isomorphic/";</script>
<script src="/gmap/smartclient/isomorphic/system/modules/ISC_Core.js"></script>
<script src="/smartclient/isomorphic/system/modules/ISC_Foundation.js"></script>
<script src="/smartclient/isomorphic/system/modules/ISC_Containers.js"></script>
<script src="/smartclient/isomorphic/system/modules/ISC_Grids.js"></script>
<script src="/smartclient/isomorphic/system/modules/ISC_Forms.js"></script>
<script src="/smartclient/isomorphic/system/modules/ISC_DataBinding.js"></script>
<script src="/smartclient/isomorphic/skins/Enterprise/load_skin.js"></script>
regardless of initialising these files before or after my own js, I still get the same error.
I am open to viable alternatives that provider a better/cleaner solution to producing large, dynamically sortable and groupable tables, in javascript.