adding more than one rows from client side

3 replies. Last post: July 26, 2010 9:45 PM by Glenn Layaar
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback
caMember

hi,

 

i have one data table returned from webservice using flypostback manager. i have to add this data to webgrid. i used the below code, but it do insert only one row. but i check the return datatable has two rows.

  function WebFlyPostBackManager3_Ongetdatafinished(returnValue)
		{
		    var dt = returnValue;
            var grid = ISGetObject("WebGrid1");
            var rowslength= dt.Rows.length;
          
            for(var i=0; i< rowslength; i++)
            {
                
              var newRow = grid.RootTable.NewRow(); 
              var cells = newRow.GetCells() ; 
          
              cells.GetNamedItem("SYSID").SetText(dt.Rows[i].Cells[0].Value, true);
              cells.GetNamedItem("ID").SetText(dt.Rows[i].Cells[1].Value, true);
              cells.GetNamedItem("REPORTNAME").SetText(dt.Rows[i].Cells[2].Value, true);
              cells.GetNamedItem("USER").SetText(dt.Rows[i].Cells[3].Value, true);
              cells.GetNamedItem("COMPANY").SetText(dt.Rows[i].Cells[4].Value, true);
              
              var tempdate= dt.Rows[i].Cells[5].Value;
              cells.GetNamedItem("REQUESTEDTIME").SetText(tempdate, true);
              
              cells.GetNamedItem("ELAPSEDTIME").SetText(dt.Rows[i].Cells[6].Value, true);
              cells.GetNamedItem("FORMAT").SetText(dt.Rows[i].Cells[7].Value, true);
              cells.GetNamedItem("REPORTFILENAME").SetText(dt.Rows[i].Cells[8].Value, true);
              cells.GetNamedItem("STATUS").SetText(dt.Rows[i].Cells[9].Value, true);
              cells.GetNamedItem("CRYSID").SetText(dt.Rows[i].Cells[10].Value, true);
              cells.GetNamedItem("VIEWED").SetText(dt.Rows[i].Cells[11].Value, true);
		      newRow.Update(); 
		      alert("add row finished")
            
            }
      } 

is there any way

 

thanks and regards

ca

All times are GMT -5. The time now is 3:44 PM.
Previous Next