Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by squatss on Jun 18, 2009 07:07
open dhtmlx forum
Addrow cases an error

Hi support,

I have a strange one. I have a grid initialised and add a row programatically.

I get the error "cell is null or not an object" on "a.cell.wasChanged=true})" bit of code.

the strange thing is, if I dont debug the code, the new row is displayed in the grid?

Any ideas?

Below is my initialisation code and the add row method.

Cheers

Scott

grd = new dhtmlXGridObject('grdPdocs');
grd.setSkin('light');
grd.setImagePath("../../imgs/");
grd.setHeader("Country Code, Priority Type, PDoc Number, Priority Date, Date Available PDAS");
grd.setInitWidths("100,100,200,130,130")
grd.setColAlign("left,left,left,left, left")
grd.setColTypes("ro");
grd.enableMultiselect(true)
grd.enableRowsHover(true,'test');
grd.init();
grd.addRow(1,"scott,thomas,is, going, home,");
Answer posted by dhxSupport on Jun 18, 2009 08:20
First parameter in addRow() method is id of a new row. So addRow() methos should looks like that:
grd.addRow("1","scott,thomas,is, going, home,");
Please check example at the attachment 
Attachments (1)
Answer posted by squatss on Jun 18, 2009 23:32

I am using a variable that is a string and it still happens:

var obj = "pd4589"

grd.addRow(obj,"scott,thomas,is, going, home,");

Cheers

 

Scott

Answer posted by Alex (support) on Jun 19, 2009 05:08

Hello,

there shouldn't be spaces in the "initialization" methods. Please, delete unnecessary space in the setColAlign method - and issue will be fixed.

Answer posted by squatss on Jun 19, 2009 05:22

The error still happens.

The process goes as follows:

  1. User clicks a button on a toolbar
  2. new modal window is launched with form for data entry
  3. user completes form clicks save button
  4. The save button click event handler calling a function on the parent window
  5. The parent window function adds the new row and closes the modal window

The add new row seems to work as you can see the newly added row but it still errors with the message:

'cell' is null or not an object line 1115

I am using the single js file for the whole suite.

 

Cheers

 

Scott

Answer posted by Alex (support) on Jun 19, 2009 05:40

Hello, 

please provide the complete demo that reproduces the problem or a direct link to the problematic page (you can send it to support@dhtmlx.com)

Answer posted on Jun 24, 2009 09:31
Hi Alex,

I was away on monday bt have since replied to the email you sent inregards with the toolbar not showing in the sample i provided.

Are you now able to recreate the problem your end?

Cheers

Scott
Answer posted by Alex (support) on Jun 25, 2009 07:24

Hello,

yes, the issue was reproduced. We have sent you details and a sample by email.