[jQuery] Re: Several questions regarding jQuery Approach...

2009-02-09 Thread jQuery Lover
.com >> [mailto:jquery...@googlegroups.com] On Behalf Of jQuery Lover >> Sent: Saturday, February 07, 2009 9:14 AM >> To: jquery-en@googlegroups.com >> Subject: [jQuery] Re: Several questions regarding jQuery Approach... >> >> >> >> 1. you can acces t

[jQuery] Re: Several questions regarding jQuery Approach...

2009-02-07 Thread Konstantin Mirin
jQuery Lover > Sent: Saturday, February 07, 2009 9:14 AM > To: jquery-en@googlegroups.com > Subject: [jQuery] Re: Several questions regarding jQuery Approach... > > > > 1. you can acces them like this $('tr td', this).each(...); > Also see here for custom pl

[jQuery] Re: Several questions regarding jQuery Approach...

2009-02-07 Thread jQuery Lover
I think namespacing is always a good idea :) Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat, Feb 7, 2009 at 3:57 PM, ShurikAg wrote: > > Thanks a lot. > > Last question, is it a good idea to pass the object just in order to > stay in the same namespace? > > On Feb

[jQuery] Re: Several questions regarding jQuery Approach...

2009-02-07 Thread ShurikAg
Thanks a lot. Last question, is it a good idea to pass the object just in order to stay in the same namespace? On Feb 7, 2:51 am, jQuery Lover wrote: > I tried to debug the code and the second alert is fired when > table.initUI() returns. > > It's probably how browsers work. When you call .tabl

[jQuery] Re: Several questions regarding jQuery Approach...

2009-02-07 Thread ShurikAg
By the way, for some reason, this: > 1. you can acces them like this $('tr td', this).each(...); Also see does not work

[jQuery] Re: Several questions regarding jQuery Approach...

2009-02-07 Thread jQuery Lover
I tried to debug the code and the second alert is fired when table.initUI() returns. It's probably how browsers work. When you call .table.initUI() it probably goes through the .table as well.. or something... sounds weird though :) Anyway, it's good you have resolved your problem :))) Good luc

[jQuery] Re: Several questions regarding jQuery Approach...

2009-02-07 Thread ShurikAg
I tried something: If I pass to initUI this, and using it as bellow: jQ.fn.table.initUI = function(obj){ if(Initialized){ //return; } Options.cols = Object.size(Titles); c = 0; //set scc if ne

[jQuery] Re: Several questions regarding jQuery Approach...

2009-02-07 Thread ShurikAg
The weird thing is that it worked perfectly well until I inserted the functions into "table" namespace... On Feb 7, 2:24 am, ShurikAg wrote: > And how come this: > > " > I'm getting this error when the lines bellow are called: > > jQ(this).addClass(Options.cssClass); > ... > tHead.append(tr).pre

[jQuery] Re: Several questions regarding jQuery Approach...

2009-02-07 Thread ShurikAg
And how come this: " I'm getting this error when the lines bellow are called: jQ(this).addClass(Options.cssClass); ... tHead.append(tr).prependTo(this); " ??? On Feb 7, 2:22 am, ShurikAg wrote: > I'm shocked!!! > > This is all I'm trying to do: > > var $table = $('.tbl'); > $table.table(); >

[jQuery] Re: Several questions regarding jQuery Approach...

2009-02-07 Thread ShurikAg
I'm shocked!!! This is all I'm trying to do: var $table = $('.tbl'); $table.table(); $table.table.SetTitles({col1:"test", col3: "test3", col5: "not exist"}); Do you get the table titles ? On Feb 7, 2:16 am, jQuery Lover wrote: > That's what I did. I put console.log() (firebug console logging)

[jQuery] Re: Several questions regarding jQuery Approach...

2009-02-07 Thread jQuery Lover
That's what I did. I put console.log() (firebug console logging). And still not getting that message. Only alert that says "table"... Probably, you are using .table() function somewhere else on non table element ??? Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat,

[jQuery] Re: Several questions regarding jQuery Approach...

2009-02-07 Thread ShurikAg
instead of "$.log() " just put alert(); you will see the error. My html is something like this: ... ... and I'm using it as: var $table = $('.tbl'); $table.table(); On Feb 7, 2:04 am, jQuery Lover wrote: > I don't have $.log() function so i just commented those lines out... > > but let me l

[jQuery] Re: Several questions regarding jQuery Approach...

2009-02-07 Thread jQuery Lover
I don't have $.log() function so i just commented those lines out... but let me log them with console.log()... NOPE, I did not. I just got a "table" alert box and that's it... Just one alert box! Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat, Feb 7, 2009 at 2:59

[jQuery] Re: Several questions regarding jQuery Approach...

2009-02-07 Thread ShurikAg
I'm getting this error when the lines bellow are called: jQ(this).addClass(Options.cssClass); ... tHead.append(tr).prependTo(this); On Feb 7, 1:56 am, ShurikAg wrote: > me too > > and do you get "The element must be valid table element!"? > > On Feb 7, 1:53 am, jQuery Lover wrote: > > > FF

[jQuery] Re: Several questions regarding jQuery Approach...

2009-02-07 Thread ShurikAg
me too and do you get "The element must be valid table element!"? On Feb 7, 1:53 am, jQuery Lover wrote: > FF3 > > > Read jQuery HowTo Resource  -  http://jquery-howto.blogspot.com > > On Sat, Feb 7, 2009 at 2:53 PM, ShurikAg wrote: > > > hm > > which browser you are working with?

[jQuery] Re: Several questions regarding jQuery Approach...

2009-02-07 Thread jQuery Lover
FF3 Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat, Feb 7, 2009 at 2:53 PM, ShurikAg wrote: > > hm > which browser you are working with? > > On Feb 7, 1:49 am, jQuery Lover wrote: >> But these lines should not cause 2 alerts... >> >> I just run you code and i

[jQuery] Re: Several questions regarding jQuery Approach...

2009-02-07 Thread ShurikAg
hm which browser you are working with? On Feb 7, 1:49 am, jQuery Lover wrote: > But these lines should not cause 2 alerts... > > I just run you code and i'm getting just one alert box ?! > > > Read jQuery HowTo Resource  -  http://jquery-howto.blogspot.com > > On Sat, Feb 7, 2009 at 2:4

[jQuery] Re: Several questions regarding jQuery Approach...

2009-02-07 Thread jQuery Lover
But these lines should not cause 2 alerts... I just run you code and i'm getting just one alert box ?! Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat, Feb 7, 2009 at 2:45 PM, ShurikAg wrote: > > I figured out that the problem starts here: > jQ(this).addClass(Opti

[jQuery] Re: Several questions regarding jQuery Approach...

2009-02-07 Thread ShurikAg
I figured out that the problem starts here: jQ(this).addClass(Options.cssClass); and here: tHead.append(tr).prependTo(this);

[jQuery] Re: Several questions regarding jQuery Approach...

2009-02-07 Thread ShurikAg
/** * */ (function(jQ) { /** * Default options */ var Defaults = { cols: 0, rows: 0, cssClass: null, //if not set will try to get it from the object itself //if titles on the first table raw is nee

[jQuery] Re: Several questions regarding jQuery Approach...

2009-02-07 Thread jQuery Lover
could you post your code with alert statements? Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat, Feb 7, 2009 at 2:19 PM, ShurikAg wrote: > > And by the way: I tried to return jQ(this)... nothing changes. > > On Feb 7, 1:18 am, ShurikAg wrote: >> Sorry, I have prob

[jQuery] Re: Several questions regarding jQuery Approach...

2009-02-07 Thread ShurikAg
And by the way: I tried to return jQ(this)... nothing changes. On Feb 7, 1:18 am, ShurikAg wrote: > Sorry, I have probably didn't enplane myself properly. > I'm running it once, but when I'm trying to track "jQ > (this).selector" (by alert), it alerts me twice in the same run: once > with table

[jQuery] Re: Several questions regarding jQuery Approach...

2009-02-07 Thread ShurikAg
Sorry, I have probably didn't enplane myself properly. I'm running it once, but when I'm trying to track "jQ (this).selector" (by alert), it alerts me twice in the same run: once with table and second is empty... On Feb 7, 1:11 am, jQuery Lover wrote: > But you are saying first time you run it,

[jQuery] Re: Several questions regarding jQuery Approach...

2009-02-07 Thread jQuery Lover
But you are saying first time you run it, it gives you 'table', the second time you run it, it says it's not a table... This means, the first time it is getting to the return statement... Or did I get you wrong ? Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat, Feb

[jQuery] Re: Several questions regarding jQuery Approach...

2009-02-07 Thread ShurikAg
But it does not even get to the return statement... On Feb 7, 12:47 am, jQuery Lover wrote: > Maybe because you are return reference to the function not a jQuery object: > >  > return this; > > Read this > post:http://jquery-howto.blogspot.com/2008/12/how-to-create-jquery-plugin-... > > It expl

[jQuery] Re: Several questions regarding jQuery Approach...

2009-02-07 Thread jQuery Lover
Maybe because you are return reference to the function not a jQuery object: > return this; Read this post: http://jquery-howto.blogspot.com/2008/12/how-to-create-jquery-plugin-extending.html It explains why you need to return jQuery object. On Sat, Feb 7, 2009 at 1:28 PM, ShurikAg wrote: >

[jQuery] Re: Several questions regarding jQuery Approach...

2009-02-07 Thread ShurikAg
Question related to the same plugin: Plugin code: jQ.fn.table = function(options, titles, data){ if(jQ(this).length == 0){ //try to find at least one element $.log("Matching element "+jQ(this).selector+" was not found!")

[jQuery] Re: Several questions regarding jQuery Approach...

2009-02-06 Thread ShurikAg
Thank you very much!!! I have just answered to all I was interested in this topic! Thanks. On Feb 6, 11:13 pm, jQuery Lover wrote: > 1. you can acces them like this $('tr td', this).each(...); Also see > here for custom plugins and > functions:http://jquery-howto.blogspot.com/search/label/plug

[jQuery] Re: Several questions regarding jQuery Approach...

2009-02-06 Thread jQuery Lover
1. you can acces them like this $('tr td', this).each(...); Also see here for custom plugins and functions: http://jquery-howto.blogspot.com/search/label/plugin 2. when you use $('table') you'll get a selection of all tables. If you do this you would get the same object instance: var $table = $(