Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by squatss on Aug 03, 2009 07:06
open dhtmlx forum
Row added wih script doesnt allow me access to cells

Hi Support,

I have a strange one, I have a grid that is empty and I am adding rows using the api.

Once the form is complete, I try to read the addedd row in order to pass info back to the server.

When I use grd.cells(row_id, col_id).getValue();

It works for the first column but not for anyother, yet when I try grd.getColumnsNum() tells me there are 5 cols and they are all visible on screen.

Thanks In advance...

Scott
Answer posted by dhxSupport on Aug 03, 2009 08:41
>>grd.cells(row_id, col_id).getValue();
Please chekc if col_id  is index of a column, not id of the column
Answer posted by squatss on Aug 03, 2009 23:48

it is, it works fine if I use a grid that has been populated via xml, it only occurs when using a grid with a row added via javascript.

I'm using ie6 with the single dhtmlx.js suite file.

Answer posted on Aug 04, 2009 02:47
What issues occurs when you are using this code? Could you please send us any kind of sample where we can reproduce this issue?
Answer posted by squatss on Aug 04, 2009 04:01

When you add a row via javascript and using the api, yu can not then access cells apart from the first one.

Attached fudged sample recreates the issue.

Steps to recreate within the sample are:

  1. select an entry from the drop down list within the toolbar
  2. click the add button from within the toolbar
  3. click the submit to das button

Cheers

 

 

Attachments (1)
Answer posted by dhxSupport on Aug 04, 2009 05:45
This issue occurs because of you set type only for the first column:
grd.setColTypes("ro");
getValue() of the other cells is not difined that's why issue occur. If you want to set column type to your column with setColTypes() method you should define types for all your cells:
grd.setColTypes("ro,ro,ro,ro,ro");

Answer posted by squatts on Aug 04, 2009 05:58

Lush.

Thanks a million