Adding Thickbox to dynamically generated links in DOM

From the day I started working  as a web developer,  jQuery has fascinated me. As a newbie to web development, I prefer writing plain javascript code at the moment(just to know the language better),  but just couldn’t resist trying out the jQuery-AJAX APIs. Okay, Let me get back! I’m working on a new feature for HeyMath! in which I used Thickbox, a popular and beautiful jQuery plugin, in a couple of pages. The page has a  table with one particular column containing thickbox links (<a class=”thickbox”>…</a>) There is a javascript function repaintTable(Object, tableid) which repaints the rows of the table(deletes the existing rows and inserts new rows based on data in the Object). This function takes care of applying the thickbox class to the links which appear in the table. When the page loads, a JSONObject which comes from the server by default, is passed on to this function. At this point, the links open happily in thickbox.  There are some other links in the page each of which gets a new JSONObject from the server through AJAX , when clicked. On success of every such AJAX call, repaintTable function is called with the new object(obtained as response) and the same table as arguments. After the first AJAX call,  the links stop opening in thickbox. Thankfully what is happening behind the scene is so simple. When the document is ready(page is loaded), all links with thickbox class(input,image map elements also) are selected and each of them is binded with a function on click event. I realised that this was not happening for the newly created links in the DOM. To do the same, I added a line of script tb_init(’a.thickbox’) at the end of the repaintTable function. Now the links with thickbox class do open in thickbox, after AJAX calls :)   This can be handy whenever a small number of  thickbox links are generated dynamically. And here is an interesting tutorial about using  jQuery to manipulate and filter data in a table. There are so much ways to make the table dynamic. I hope to use this also!

Life logger

There are a lot of things, both good and bad, that have happened since I logged out from wordpress last time, just that I haven’t penned them down. Good things first. Did I tell you that I got a bike? Yeah, a black honda unicorn. And did I tell you that I managed to ride 1700 kms in 75 days without any accidents or curses from co-riders? Riding it on the highway brings so much pleasure that I completely enjoy riding on the stretch from Chrompet to Guindy which takes about 20 minutes. After that, riding through Saidapet and Nandanam becomes a pain with lot of signals, slow movement of traffic, and people crossing the road whenever they like, showing palms as if they belong to Congress. Anyway I reach my office in 50 minutes by bike (compare it to 110 minutes byMTC).  So, after 4 years, my MCWG/LMV license found a purpose to serve other than being identity proof for SIM cards :) I learned to ride only after getting the bike but people haven’t stopped teasing me commenting about my speed. But I would never compromise on safety and fuel efficiency(mileage) for speed, especially after witnessing so many bad drivers out there !
One more surprise was that my good friend and college mate rave has shifted his house to Tambaram Sanatorium reachable in just 10 minutes from my house(of course, in bike) ;) Went to his house last week end and met him. Expecting to meet him more often !
Time to list the bad things -  Fire Accident The place was just 4 houses away from my house. The baby’s mother also died few days back, after spending nearly 2 weeks in hospital. This bizarre fire accident had a deep impact leaving me sleepless for days.
My mother’s health is still on the decline. Right from my childhood and  society even up to my college days, she used to be hyper active doing ten different things at a time. It is very sad to see such a person now becoming very passive, fighting against heart problems and low BP, chronic neck pain adding to the list. As she feels a support in me, I once again realized the importance and significance of that one decision which I took in haste – leaving Bangalore and hence Veveo (they were paying me a hefty salary) to come back to Chennai. It  happened to be one of the very few right decisions I’ve taken in my life.
Amidst all these, the urge to bring some changes in the society never left me. Recently, I joined BHUMI as an experiment. There are a number of reasons for why I wanted to try BHUMI when there are hundreds of NGOs. May need a separate post for that. But right now, no comments about it. I’ve to wait and see how different is it from NGOs, to what extent the words are translated to action and how significant is the change it brings about.

More things are there to write, especially about things I’m doing at HeyMath!  So in all probability, I won’t take much time to be back here :)

Never give up!

Never give up!

Don't ever think of giving up!

An interesting picture I came across today!

Slum Dog Millionaire is not a great film

I resisted myself  from writing about this but unfortunately I couldn’t. Those who are excited about this film winning the oscars might know it themselves. Let me make one thing clear. I’m not a hater of this movie! I also liked the movie when I watched it.  It had a different  contemporary story line and of course, was a well taken movie. But there was literally nothing in the movie that deserved so much. What reality does the movie convey? Does Boyle think slums are only in India and not in UK? Are there no good things happening for the people in slums? Are communal tensions only in Indian slums? Does he think his country is free of racism? Then why the hell he chose India? Ok, let’s assume everything against India for the above. So, at least, was it a serious movie depicting these problems in India? No way! The reality or the seriousness just ends with the performance of street children in the movie and many indian movies have already done it better. The movie turned almost comic there after – right from mafia boss eating sandwich to the song-dance masala at the end. How is the movie really different from an average bollywood movie where love wins amidst problems? you’ve to be honest to understand it’s definitely not worth the hype that has been created. One simple reason the film has got so much recognition from the west  is the fact that west just loves to see India as one big slum and whoever shows it like that will be awarded and rewarded. Rahman receives awards for this kind of a film when he has composed extra ordinary music for various films and albums. And he dedicates them for India :(   Absolute disappointment is not the West seeing India as a slum, but we indians looking at it the same way! Let us just kill the habit of over hyping  every thing that comes from the west!