Hi,
In the sample code you provided, I don't think you even need to reset. The
setRows function works on the underlying datatable and not on the view, so I
think you can simply go ahead and call
view.setRows(view.getFilteredRows([{column: 3, inValue: 10}, {column: 4,
minValue: 10}])) without calling view.setRows(1, 47) first.
I hope this helps.
Cheers,
Yaniv
On Mon, Jun 15, 2009 at 9:50 PM, DanBo <[email protected]> wrote:
>
> Is there a better/faster method for resetting filter on a dataview so
> that you don't have to set the rows back to the full extent of the
> orignal array?
>
> // Code Start
> var view = new google.visualization.DataView(data);
> view.setRows(view.getFilteredRows([{column: 3, minValue: 0}, {column:
> 4, minValue: 0}]));
>
> var table = new google.visualization.Table(document.getElementById
> ('table'));
> table.draw(view1);
>
> // reset view
> view.setRows(1, 47); // <-- Is this the only method?
> view.setRows(view.getFilteredRows([{column: 3, minValue: 10}, {column:
> 4, minValue: 10}]));
>
> var table1 = new google.visualization.Table(document.getElementById
> ('table1'));
> table1.draw(view);
>
> // Code End
>
> Thanks,
> Dan
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-visualization-api?hl=en
-~----------~----~----~----~------~----~------~--~---