Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #20038
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx05.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | "Tony" <tony.johansson@inport.com> |
| Newsgroups | comp.lang.javascript |
| Subject | Re: I want to use the passed argument to clear the table |
| Date | Wed, 29 May 2013 17:14:38 +0200 |
| Organization | A noiseless patient Spider |
| Lines | 1 |
| Message-ID | <ko55os$ed6$1@dont-email.me> (permalink) |
| References | <ko4r9n$fuj$1@dont-email.me> <ko4rq5$hi4$1@speranza.aioe.org> <ko4sn0$n7v$1@dont-email.me> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; format=flowed; charset="iso-8859-1"; reply-type=response |
| Content-Transfer-Encoding | 7bit |
| Injection-Date | Wed, 29 May 2013 15:10:20 +0000 (UTC) |
| Injection-Info | mx05.eternal-september.org; posting-host="04290fff4557273ca84c3ad616751e0b"; logging-data="14758"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/w3XctLuR3FNzbyvHv0jmMnccFsm1kv48=" |
| X-MimeOLE | Produced By Microsoft MimeOLE V15.4.3555.308 |
| In-Reply-To | <ko4sn0$n7v$1@dont-email.me> |
| X-Newsreader | Microsoft Windows Live Mail 15.4.3555.308 |
| Importance | Normal |
| Cancel-Lock | sha1:AGoqTFyk6YTQcCJjUKqKZxzfQis= |
| X-Priority | 3 |
| X-MSMail-Priority | Normal |
| Xref | csiph.com comp.lang.javascript:20038 |
Show key headers only | View raw
I did it like this and now it works.
function CleanAllRows(tableID)
{
$("#" + tableID).find("tr:gt(0)").remove();
}
"Tony" wrote in message news:ko4sn0$n7v$1@dont-email.me...
I thought I found it when I wrote like this
$("#" + "tableID" + " tr:gt(0)").remove();
but I was wrong.
The only thing that seems to work is if I write like this
$("#myGrid tr:gt(0)").remove();
It anyone that have any suggestion ?
//Tony
"Christoph Becker" wrote in message news:ko4rq5$hi4$1@speranza.aioe.org...
Tony wrote:
> If I use this row
> $("#myGrid tr:gt(0)").remove();
> It works and all rows except the first one is removed in table with
> id=myGrid
>
> But if I use the passed argument which is myGrid in
> this row
> $("#" + tableID + "tr:gt(0)").remove();
> it does't work.
>
> How should I write ?
Just do an
alert("#" + tableID + "tr:gt(0)");
and you'll probably can spot the error. :)
--
Christoph M. Becker
Back to comp.lang.javascript | Previous | Next — Previous in thread | Find similar | Unroll thread
I want to use the passed argument to clear the table "Tony" <tony.johansson@inport.com> - 2013-05-29 14:15 +0200
Re: I want to use the passed argument to clear the table Christoph Becker <cmbecker69@gmx.de> - 2013-05-29 14:20 +0200
Re: I want to use the passed argument to clear the table "Tony" <tony.johansson@inport.com> - 2013-05-29 14:40 +0200
Re: I want to use the passed argument to clear the table Denis McMahon <denismfmcmahon@gmail.com> - 2013-05-29 13:14 +0000
Re: I want to use the passed argument to clear the table "Tony" <tony.johansson@inport.com> - 2013-05-29 17:14 +0200
csiph-web