I came back to my COde An I found your code fit in mine I am not going
to use rowIndex because My Plugin it should work for every selector so
what I atually want to do to get the selector name and bind an event
to it and sent it to a function and also pass the index to the
function and the reason I'm doing this is because I have some
recursive functions in it and I badly needed this to be done .


  var RowSet={
    close:false,
        eventClass:"eventClass",
        eventType:"click",
        ActionSelector:"tr"
  }

  function clickFunc(e){
          console.log(e.data.Index);
  }
  $.fn.RowEffectByEvent=function(options){
        RowSet = jQuery.extend({},RowSet,options);
        return this.each(function(){
          oo=$(this);
          var k=(settings.header) ? ":not(:first)" : "";
          $(RowSet.ActionSelector+k,oo).each(function(index){
                        $(this).bind(RowSet.eventType,{Index:index},clickFunc);
          });
        });
  };

this is what I actually wanted to do thanks a lot guys you helped me
alot and also RobG A appreciate it . thanks for the Tutorial also.


On Feb 9, 1:26 pm, Ricardo Tomasi <ricardob...@gmail.com> wrote:
> $("table tr").each(function( index ){
>   $(this).click(function(){
>      alert('I am TR number ' + index);
>   });
>
> });
>
> the index() function works on a collection of elements, so you'd have
> to get them first:
>
> $('table tr').click(function(){
>    alert( $(this).parent().children().index(this) );
>
> });
>
> On Feb 9, 5:48 pm, Pedram <pedram...@gmail.com> wrote:
>
> > How COme we could not have access inside the BIND with THIS !! I'm
> > Confused
>
> > On Feb 9, 7:16 am, Pedram <pedram...@gmail.com> wrote:
>
> > > I check these two solutions it didn't work ...
>
> > > On Feb 8, 11:42 pm, RobG <rg...@iinet.net.au> wrote:
>
> > > > On Feb 9, 4:54 pm, Pedram <pedram...@gmail.com> wrote:
>
> > > > > Dear folk,
> > > > > I want to get the index of the TR and send it to the Function , I
> > > > > don't know how to it . this is what I'm trying to do
>
> > > > > $("table tr").bind("click",{IndexName:$(this).index(this)},clickFunc)
>
> > > > The DOM 2 HTML TR.rowIndex property should do the job.
>
> > > > --
> > > > Rob

Reply via email to