rwjblue / pivot.js

Build Pivot Tables from CSV/JSON Data
http://rwjblue.github.com/pivot.js/
Other
783 stars 134 forks source link

build_filter_field is bound to all #filter-list selects #2

Closed ethul closed 12 years ago

ethul commented 12 years ago

Noticed a small issue in the jquery_pivot.js where the method build_filter_field is bound to the change event of each select in the #filter-list. Not sure if this is the best fix, but the following worked for me.

$('#filter-list select:first').change(function(){
  methods.build_filter_field($(this).val());
})

Also, I want to mention that Pivot.js is great, thanks for it!

Best, -Eric

PS - On a side note, what are your thoughts on adding quotes around the field name on line 197. Just to allow for field names with spaces.

var elem = $(div + ' input[data-field="' + fieldName +'"]');
rondale-sc commented 12 years ago

Hello Eric,

First of all, thanks for taking an interest in Pivot.js. I took a look at this issue and fixed it with commit 9e31ee5900. Your approach would definitely work, but I thought explicitly setting the id of, what I'm calling, the select-constructor would be a little more clear down the road.

As far as adding quotes around field name I like the idea, seems pretty straightforward. You should put a pull request together and we'll see if we can add you to the contributors file, :).

Thank you for taking the time to let us know about this.

Regards, Jonathan

rondale-sc commented 12 years ago

I'm going to close this issue as resolved.

ethul commented 12 years ago

hi Jonathan,

Thanks for the quick fix! I will get a pull request together for the quotes around the field name.

Cheers, -Eric