various fixes for querytable and googlemap
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Thu, 12 Dec 2013 14:24:37 +0000 (15:24 +0100)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Thu, 12 Dec 2013 14:24:37 +0000 (15:24 +0100)
display is hostname-based now
could be made hrn again very simply
internal communication is urn-based
should work fine now

plugins/googlemap/__init__.py
plugins/googlemap/static/js/googlemap.js

index 8ceaec6..583b8dd 100644 (file)
@@ -44,4 +44,8 @@ class GoogleMap (Plugin):
         return reqs
 
     # the list of things passed to the js plugin
-    def json_settings_list (self): return ['plugin_uuid','query_uuid', 'query_all_uuid', 'latitude', 'longitude', 'zoom', ]
+    def json_settings_list (self): 
+        return [ 'plugin_uuid', 'query_uuid', 'query_all_uuid',
+                 'init_key',
+                 'latitude', 'longitude', 'zoom', 
+                 ]
index 7346f73..2feb424 100644 (file)
        // retrieve DOM checkbox and make sure it is checked/unchecked
        set_checkbox_from_record: function(record, checked) {
            var init_id=record[this.init_key];
-           var checkbox = this.by_id [ init_id ];
-           checkbox.prop('checked',checked);
+           var checkbox = this.by_init_id [ init_id ];
+           if (checkbox) checkbox.prop('checked',checked);
+           else this.warning(record, "googlemap.set_checkbox_from_record - not found "+init_id);
        }, 
 
        set_checkbox_from_data: function(id, checked) {
-           var id=record[this.canonical_key];
+           var id=record [this.canonical_key];
            var checkbox = this.by_id [ id ];
-           checkbox.prop('checked',checked);
+           if (checkbox) checkbox.prop('checked',checked);
+           else this.warning(record, "googlemap.set_checkbox_from_data - not found "+init_id);
        }, 
 
        // this record is *in* the slice