4 messages in com.googlegroups.google-visualization-api[visualization-api] Re: Remove row fr...
FromSent OnAttachments
Burnt20 Jun 2008 10:57 
VizGuy (Google)24 Jun 2008 01:36 
adam17 Jul 2008 15:27 
adam17 Jul 2008 18:05 
Subject:[visualization-api] Re: Remove row from DataTable?
From:adam (a.re@gmail.com)
Date:07/17/2008 03:27:52 PM
List:com.googlegroups.google-visualization-api

if you're desperate, you can use this function, in the form data = removeRow(data,[RowNumber]) -

--------------------------------------- function removeRow(dataSet,rowId) { var newData = new google.visualization.DataTable(); newData.addRows(dataSet.getNumberOfRows()-1); for(var c=0; c<dataSet.getNumberOfColumns(); c++){

newData.addColumn(dataSet.getColumnType(c),dataSet.getColumnLabel(c),dataSet.getColumnId(c)); } var r =0; for(var i=0; i<dataSet.getNumberOfRows(); i++) { if(i!=rowId){ for(var j=0;j < dataSet.getNumberOfColumns();j++){

newData.setCell(r,j,dataSet.getValue(i,j),dataSet.getFormattedValue(i,j)); } r++; } } return newData; }

---------------------------------------

i've tested it on a simple table, and it seems to work fine.

On Jun 21, 3:57 am, Burnt <bern@yahoo.de> wrote:

Hi folks,

is it possible to remove a row from a data table, just like adding one?

Cheers, Bernd