Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Terbeaux333 on Aug 17, 2009 09:05
open dhtmlx forum
Link in TreeGrid only works one time

I'm using the TreeGrid and i have the following column types:

myGrid.setColTypes("tree,ro")

I then feed it the following XML:

<rows>
<row id="1" open="1"><cell>Project List</cell><cell/>
<row id="1.1">
<cell>
<![CDATA[<a href="javascript:void(0)" onClick="someFunction('data')">Project 1</a>]]>
</cell>
<cell/>
</row>
</row>
</rows>

The problem I'm seeing is that the embedded link is only good for 1 click. After that, I get the following error when I click on the link:

"someFunction is not a function"

I have also tried embedding the following link. It also produces the same error.

<![CDATA[<span onClick="someFunction('data')">Project 1</span>]]


Am I doing something wrong or is this a bug? The intent of the a href / span is to provide a hook for calling a javascript function.

Thanks for any direction/bug fixes you can provide,

Terbeaux333
Answer posted by Alex (support) on Aug 17, 2009 09:16

Hello, 

The link is correct. Please check that someFunction is define on the page with treegrid. 

If the issue isn't solved, please provide the demo to support@dhtmlx.com

Answer posted by Terbeaux333 on Aug 17, 2009 09:22
You are absolutely correct.  The bug was on my side.  I was clobering the function, someFunction within the function itself.

Sorry for the inconvenience,

Terbeaux333