rwjblue / pivot.js

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

label-fields is empty #8

Closed pilap82 closed 11 years ago

pilap82 commented 11 years ago

Hi, I've been trying to figure out why my label-fields div is empty for 2 hours.

So I've tried to copy/paste the examples on github (example with jQuery)... and the div is still empty.

Is there a bug, or am I missing something? (the filter and summary fields work great)

in my header:

csv = "last_name,first_name,email,date_ordered,date_delivered,sale_price,unit_identifier\n" +
     "doo, scooby, scoobydoo12512@gmail.com,2012-02-12,2012-02-17,9.99,big-bang-rpsls\n" +
     "flinstone,fred,freddyf12516@gmail.com,2012-02-12,2012-02-17,9.99,dr-who-bad-wolf\n" +
     "spiegel,spike,bebop1256@gmail.com,2012-02-12,2012-02-17,9.99,tng-engage\n"; //etc

fields =[{name: 'last_name',      type: 'string',   filterable: true},
         {name: 'first_name',     type: 'string',   filterable: true},
         {name: 'email',          type: 'string',   filterable: true},
         {name: 'date_ordered',   type: 'date',     filterable: true},
         {name: 'date_delivered', type: 'date',     labelable: false},
         {name: 'sale_price',     type: 'float',    filterable: true},
         {name: 'unit_identifier',type: 'string',   filterable: true, summarizable: 'count' }];

  $('#pivot-menu-container').pivot_display('setup', {csv:csv,fields:fields});

and in my HTML:

<div class="row">
  <div class="span12">
    <div id="pivot-menu-container"></div>
    <div id="results"></div>
  </div>
</div>

Screen Shot 2013-03-03 at 14 22 01

thanks for your help. p.

rwjblue commented 11 years ago

Looks like we added the ability to have column label and row label fields (rowLabelable and columnLabelable), but didn't update the automatically built containers. The demo site was working properly because we are manually building the right divs, but the #build_containers function wasn't building properly.

I have also added a simple example to the repo to make testing somewhat easier.

rwjblue commented 11 years ago

I think this issue is resolved.

Please let me know if you are still having a problem...