diff --git a/lib/volcanotable_client.js b/lib/volcanotable_client.js index 9fdb252..6242301 100644 --- a/lib/volcanotable_client.js +++ b/lib/volcanotable_client.js @@ -115,8 +115,14 @@ attributes = attributes.join(' '); switch(input_type) { - case 'text' : case 'checkbox' : + console.log( input_type+", "+value); + input = ''; + break; + case 'text' : case 'number' : input = ''; @@ -193,7 +199,12 @@ var limit = this.paginationNumber; var skip = (current_page - 1) * limit; this.fields = this.settings.fields; - + var where2 = this.settings.where; + + _.extend(where, where2 || {}); + + console.log( "%j", where ); + var data = { filter : where, options : { @@ -208,7 +219,9 @@ var passed_template = template.view.parentView.parentView.name; passed_template = passed_template.replace('Template.', ''); + console.log(passed_template); Meteor.subscribe(passed_template, data); + Meteor.subscribe('VolcanoTableCounts', { filter : where, template : passed_template @@ -309,8 +322,18 @@ var value = $this.val(); var id = $this.closest('tr').data('record'); var new_data = {}; - new_data[key] = value; + + + if( e.target.type == "checkbox") { + if( e.target.checked) + value = "true"; + else + value = "false"; + } + + new_data[key] = value; + // Don't update when it's a new record if($this.hasClass('volcanotable-add-input')) { return; @@ -321,7 +344,7 @@ $this.val(template.data.currentDataFieldValue.get()); return; } - + collection.update({ _id : id }, { $set : new_data });