SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    May 2008
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Build your own Ajaxs applications - Chapter 5

    Hi,

    has anybody been able to put example of chapter 5 in practice?

    The chapter starts with entering some sample entries to the page.
    As a temporary measure, we’ll attach event handlers to the ondblclick events of these two entries in the init method of our Blog class:
    so enter

    var entry1 = document.getElementById('main1');
    var entry2 = document.getElementById('main2');
    entry1.ondblclick = self.toggleEditInPlace;
    entry2.ondblclick = self.toggleEditInPlace;

    and then it goes on saying:

    We’ll replace this code later, but it will serve our current development purposes just fine.
    And that's all working fine, but as I read the chapter I did not find any replacement.

    Lets say I like to use it on real web site where I would have 15+ comments. How can I attach the double click event to all of them? In the book
    we hard wire 2 comments but that about it.

    Obviously the code should be finding all available comments and making them editable on the double click event.

    Did I miss something? Please if you have some experience, let me know.

    Thanks

  2. #2
    #titanic {float:none} silver trophy
    molona's Avatar
    Join Date
    Feb 2005
    Location
    from Madrid to Heaven
    Posts
    8,220
    Mentioned
    237 Post(s)
    Tagged
    1 Thread(s)
    I need to read the chapter itself so my answer may not be very accurate... but if you are thinking about generalising the concept, you'll need a function that sets a generic var entry with the correct elment ID and then toggle the Edition.

    Now, I don't remember the code so I'd probably need to read the chapter again. More into JQuery these days

  3. #3
    SitePoint Member
    Join Date
    May 2008
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your reply!

    I have a project where I need to implement a solid solution for edit in place functionality.

    Do you know about any good solutions?


    Thanks

  4. #4
    #titanic {float:none} silver trophy
    molona's Avatar
    Join Date
    Feb 2005
    Location
    from Madrid to Heaven
    Posts
    8,220
    Mentioned
    237 Post(s)
    Tagged
    1 Thread(s)
    There are plenty of examples out there with and without JQuery. Are you creating the page, or are you using something like Joomla or WordPress or any other CMS?

  5. #5
    SitePoint Member
    Join Date
    May 2008
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am not using any CMS, just building stand alone application.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •