473,473 Members | 2,193 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Clearing all elements from within a named table.

Daz
Hello everyone. I have a simple problem which can be solved quite
simply, I am just going about it the wrong way. I would like to wipe
every row from within a named table, but I am not too sure how to do
it.

Each of these rows, are part of a JavaScript Object, which is bound to
the table by objectName.bind('idOfTableToBindTo').

I have tried to destroy the objects themselves, but they still remain.
Perhaps I am doing something wrong... I have tried to make a function
that will loop through all of the 'tr' elements withing the table, and
failed dismally. I know that this can be done, I just can't seem to
figure out how.

As my object can be bound to the table, but still remains when I delete
the variable pointing to the object (which I thought would delete the
object itself).

Is there any way that I can put a function within my object that will
make it destroy itself?

I would assume that an object can't destroy itself, and that it needs
to be done externally, but I am not sure, as I am just assuming.

Please could someone suggest a method I can use to loop through all of
the childElements in a table and delete them?

Also, is there a way to actually delete the object itself, rather than
just the variable pointing to it. It may be the case that it's already
deleting the object, but it doesn't look like it. The more I think
about what it's doing, the more I confuse myself about the entire
issue.

All the best.

Daz.

Nov 17 '06 #1
4 1614
Hi Daz,

Daz wrote:
Hello everyone. I have a simple problem which can be solved quite
simply, I am just going about it the wrong way. I would like to wipe
every row from within a named table, but I am not too sure how to do
it.
Can you post a complete example (HTML with JavaScript in head element)
in 30 lines or less that shows how you are trying to do this?

Peter

Nov 17 '06 #2
Daz

Peter Michaux wrote:
Hi Daz,

Daz wrote:
Hello everyone. I have a simple problem which can be solved quite
simply, I am just going about it the wrong way. I would like to wipe
every row from within a named table, but I am not too sure how to do
it.

Can you post a complete example (HTML with JavaScript in head element)
in 30 lines or less that shows how you are trying to do this?

Peter
Hi Peter. I'm not entirely sure. The class itself is about 250 lines,
as it creates a LOT of DOM elements on-the-fly. Would you like me to
try and summerise it?

Everything works in the code, I just cannot seem to remove or unbind
the elements once they have been added to the table. Once again, I know
this is possible, I just don't know any methods to achieve this, and
those I have tried have failed.

Nov 17 '06 #3
Daz wrote:
Peter Michaux wrote:
Hi Daz,

Daz wrote:
Hello everyone. I have a simple problem which can be solved quite
simply, I am just going about it the wrong way. I would like to wipe
every row from within a named table, but I am not too sure how to do
it.
Can you post a complete example (HTML with JavaScript in head element)
in 30 lines or less that shows how you are trying to do this?

Peter

Hi Peter. I'm not entirely sure. The class itself is about 250 lines,
as it creates a LOT of DOM elements on-the-fly. Would you like me to
try and summerise it?
You may sort it out yourself as you do this.

Peter

Nov 18 '06 #4
Daz

Daz wrote:
Peter Michaux wrote:
Hi Daz,

Daz wrote:
Hello everyone. I have a simple problem which can be solved quite
simply, I am just going about it the wrong way. I would like to wipe
every row from within a named table, but I am not too sure how to do
it.
Can you post a complete example (HTML with JavaScript in head element)
in 30 lines or less that shows how you are trying to do this?

Peter

Hi Peter. I'm not entirely sure. The class itself is about 250 lines,
as it creates a LOT of DOM elements on-the-fly. Would you like me to
try and summerise it?

Everything works in the code, I just cannot seem to remove or unbind
the elements once they have been added to the table. Once again, I know
this is possible, I just don't know any methods to achieve this, and
those I have tried have failed.
Ok, I have an update to my previous post. I am using the Web Developer
Extension for Firefox, and I have spotted something rather odd. As I
mentioned before, my objects are created within a table row, and bind
to a hard-coded table in my document. I have enabled table and cell
outlining with the Web Developer Extension, and the table for that my
objects are bound to is outlines, as are the newly appended rows.
However, the old rows are non-existent (which is a good thing), but the
new rows are inserted from the point where the last rows ended. So I
have a blank section at the top of my table. Each time I press the
submit button to make the calculations, delete the right elements and
then make new objects and append them to the table, the new objects are
always inserted at the point where the old objects ended before they
were deleted.

Basically, Each time I press the submit button, the old
objects/elements are cleared, but the new ones are shifted down the
table. If I push the submit button three times, the new rows disappear
from the bottom of the page...

Nov 18 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Doug Estep | last post by:
Below is a sample of my XML… <MetaData> <Table name="mytable"> <PrimaryKey name="pk"><Column name="mycolumn"/></PrimaryKey> </Table> </MetaData> <Sequencer> <Table name="mytable">
9
by: Stanimir Stamenkov | last post by:
Using Xerces2 Java I'm trying to validate a CSV data following an XNI example <http://xml.apache.org/xerces2-j/xni-config.html#examples>. The CSV scanner generates XML tree events like: <csv>...
2
by: Falc2199 | last post by:
i all, I have an HTML table within which I have a span. When the user clicks a button I want to update the contents of this span with form elements table elements (TR,TD). The problem is that...
15
by: Christopher Benson-Manica | last post by:
When are named elements written with script accessible to script? <html><head><script type="text/javascript"> function ready() { alert( document.getElementsByName("div").length ); }...
33
by: abs | last post by:
Hi all. My list: <ul> <li id="a" onclick="show(this)">Aaaaaaaa</li> <li id="b" onclick="show(this)">Bbbbbbbb</li> <li id="c" onclick="show(this)">Cccccccc <ul> <li id="d"...
8
by: David | last post by:
I wonder if someone could tell me where I am going wrong with this script. The original implementation of finding a DL list and separating it by dt | dd groups and making new DL's from them worked...
4
by: Claudio Calboni | last post by:
Hello folks, I'm having some performance issues with the client-side part of my application. Basically, it renders a huge HTML table (about 20'000 cells in my testing scenario), without content....
1
by: Esteban404 | last post by:
//using C# 2005, MS SQL 2000(prod) and SQL Express 2005 (dev) My sprocs all have a clearing mechanism at the end like this for each temporary table I use: --drop temporary tables IF...
3
by: ibeehbk | last post by:
Hi. I have a form made in xhtml. I test via vbscript to make sure none of the fields are empty and properly formatted (ie email). All the regular fields work. However, I have two drop down menus...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.