Monday, September 29, 2008

[jQuery] Re: Metadata parameter as selector

Erik, this is the solution I was looking for. Thanks also for making
test page live.

While we have there two solutions, I did a benchmark for both and here
are the results, just for fun (1000x loop). :)
Ricardo: 2406ms
Erik: 2812ms (with filter)


Thanks again to both of you.

On Sep 30, 12:07 am, me-and-jQuery <brilko.bri...@gmail.com> wrote:
> Thanks ricardo, this one is tricky but it works. :)
>
> Amardeep, I was talking about querying parameters defined with
> metadata plugin, not classic DOM id.
>
> On Sep 29, 10:44 pm, ricardobeat <ricardob...@gmail.com> wrote:
>
> > You can use the attribute filters:
>
> > $('table tr[data*=id:4]')
>
> >http://docs.jquery.com/Selectors
>
> > - ricardo
>
> > On Sep 29, 2:23 pm, me-and-jQuery <brilko.bri...@gmail.com> wrote:
>
> > > I am searching the web and documentation and still can't find a
> > > working solution.
>
> > > I have a table which rows has also id with metadata, for example <tr
> > > data="{id:4}">
>
> > > And now I want to select row with id 4. I was trying many ways but no
> > > success for now. For example:
>
> > > $.metadata.setType("attr", "data")
> > > $("table tr.id:4").metadata().remove();
>
> > > Anyway, is this possible with metadata at all? Thanks for any help.

No comments: