rwjblue / pivot.js

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

Multiple pivot tables on a page #22

Open shelly-skeens opened 10 years ago

shelly-skeens commented 10 years ago

Any suggestions on going about getting pivot.js to work with multiple tables on a single page? I've created a new setup option in order pass in a unique html div id (and also create unique sub-elements). Everything loads correctly with multiple tables, but I'm having problems with row and column filtering and scope. The fields array in pivot.config() shows all the fields in all the tables, for instance.

This is a great plugin, by the way!

alexhgreen07 commented 10 years ago

I'd also like to see this feature included in this library. A few ideas on how to go about this are below:

function pivot(initialization_arguments)
{
        //initialize variables

        this.function1 = function(args)
        {
                //...code
        }

        this.function2 = function(args)
        {
                //...code
        }
}
var pivot_table1 = new pivot(pivot1_arguments);
var pivot_table2 = new pivot(pivot2_arguments);

If this feature is valuable to other users I can attempt to implement something.

shelly-skeens commented 10 years ago

Thank you for the pointers. I use jquery quite a bit but I've never authored a plugin. I may try to do something as I get time, since this library has been quite useful.

Needless to say, I would definitely find it valuable if you were to implement something!

vijay777pawar commented 10 years ago

Yes , alexhgreen07 I tried Creating New Instance ..Dosen't Works .... It Is Some Thing Less In This Library..... It Needs multiple Instance functionality......

Multiple Datatable On Single Page Works. But, Multiple Only Pivot On Dosen't Works. After integration, Multiple (Datatable + OnlyPivot) Also On Dosen't Works.

JonForest commented 10 years ago

I've written some code to support multiple reports on a single page in our product. As mentioned already, it basically involves changing pivot.js and jquery-pivot.js to be instantiatable objects rather than singletons, plus a few other tweaks to support this. I'm thinking of putting in a PR for the work when I get some time, do you think there would be any interest? Unfortunately, it is impossible to do and not break existing implementations. (I think)

rwjblue commented 10 years ago

Sounds interesting to me.

JonForest commented 10 years ago

Cool. Well, I'm away from a keyboard for three weeks, but once I'm back I'll try and work on this in my downtime.

rwjblue commented 10 years ago

Sweet. Thanks!

shelly-skeens commented 10 years ago

I haven't used Pivot for the last few months, but I for one would love to see this happen, JonForest. This plugin has been incredibly useful!