PDA

View Full Version : problem with deletenode


thipperudra
04-07-2004, 04:34 AM
Hi Antun,

<dataset name="dataset" />
<view datapath="dataset:/myimage" >
<button>Delete
<mehod event="onclick">
<![CDATA[
for( var i=1;i<=5;i++)
{
this.parent.datapath.deleteNode();
this.parent.datapath.selectPrev();
}
]]>
</method>
</button>
</view>

This is code sample what i am using now.i created no of view by using LzDatapointer.addNodeFromPointer(dp),but i was deleting all these created view by using above code in lps-1.0.3 and it was working fine.But if i run the same (above) code in lps-2.1.1 just delete latest view and not all.I don't know what is the wrong in this code.Please give any ideas.

Thanks in advance.
-Rudresh

antun
04-07-2004, 10:43 AM
It would be helpful if you could post the code that created the datanodes.

Also, don't name elements "dataset". Avoid naming things after a class that exists either in LZX (e.g. view, dataset, datapointer) or in JavaScript (e.g. math, date, array):


<dataset name="dataset" />

Better:
<dataset name="mydataset" />


You might want to look at the new "p" attribute of datapath in LPS 2.0 - it's a pointer to the new LzDataNode (http://www.laszlosystems.com/lps-2.1/docs/lzx-reference/?lzdatanode.html)instance that is the actual XML node in the dataset that the view is bound to. Not sure if this relates to what you're doing, but you should be aware of it.

-Antun

thipperudra
04-11-2004, 09:59 PM
Hi Antun,

I want to delete all nodes of a dataset at a time.How can i do this in laszlo.

Tahnks in Advance,

Rudresh

antun
04-12-2004, 08:24 AM
See here:

http://www.laszlosystems.com/developers/community/forums/showthread.php?s=&threadid=301&highlight=delete+nodes+dataset