Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8420433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T02:53:11+00:00 2026-06-10T02:53:11+00:00

Here we go, the variable $thislistitem, in bold below, is in the same place

  • 0

Here we go, the variable $thislistitem, in bold below, is in the same place in my function. I seperated it to bold it. Focus on the jquery ui buttons being created and the click events.

        function activatequalifdetails($subgrid, qualId){
            $subgrid.find('.itemcontrols').hide();
            $subgrid.find("#detailedsubjects ol").on("click", "li", function(event){
                event.stopPropagation();
                        var $itemwithfoucsclass = $(".focus");
/* <![CDATA[ */         if(($itemwithfoucsclass[0] != $(this)[0]) && ($itemwithfoucsclass.length !== 0)){           /* ]]> */ 
                            $.post('<c:url value="/highschooldetailedqualifications/highschoolqualdetailedajaxupdate/"/>'+$itemwithfoucsclass.find('.itemcontrols button:nth-child(1)').attr("qualdetailid"), {grade: $itemwithfoucsclass.find('.grade').val(), yearattained: $itemwithfoucsclass.find('.yearAttained').val()});
                        }

var $thislistitem = $(this);

        $subgrid.find('#detailedsubjects ol li').not(this).removeClass('focus').find('.itemcontrols').hide();               
        $(this).addClass("focus").find('.itemcontrols').show();

            $(this).find('.itemcontrols button:nth-child(1)').button({
                icons: {
                    primary: "ui-icon-disk"
                },
                text: false
            }).unbind('click').click(function(){
                $.post('<c:url value="/highschooldetailedqualifications/highschoolqualdetailedajaxupdate/"/>'+$(this).attr("qualdetailid"), {grade: $thislistitem.find('.grade').val(), yearattained: $thislistitem.find('.yearAttained').val()}, function(data){
                    $thislistitem.removeClass('focus').find('.itemcontrols').hide();
                });
            });

            $(this).find('.itemcontrols button:nth-child(2)').button({
                icons: {
                    primary: "ui-icon-trash"
                },
                text: false
            }).unbind('click').click(function(){
                $.get('<c:url value="/highschooldetailedqualifications/highschoolqualdetailedajaxdelete/"/>'+qualId+'/'+$(this).attr("qualdetailid"), function(data){
                    $thislistitem.remove();
                });
            });

            $(this).find('.itemcontrols button:nth-child(3)').button({
                icons: {
                    primary: "ui-icon-closethick"
                },
                text: false
            }).unbind('click').click(function(){
                $thislistitem.removeClass('focus').find('.itemcontrols').hide()
            });             
    });//apply css class on click on any given item
}

The click events for the save and delete work perfectly. The click event for the cancel button however (3rd button) is giving some starnge behavior. The click logic for the 3rd button is identical to that of the save, only difference is the icon and no post id required.

When I click the cancel button, nothing happens.
If I do

.unbind('click').click(function(){
                    $thislistitem.remove();
                });

for the 3rd button, it works.

If I alert some test text, it works fine. If use removeClass() nothing occurs.
I tried copying and pasting the save function as is, change the icon and so on and left the ajax call intact. this worked fine and the focus class was removed. If I remove the ajax call and run the logic as seen in the function above, well nothing happens. Firebug reports nothing.

I have several versions of jquery loaded on this page, (1.4.3, 1.4.2, 1.5.1, 1.6.2 & 1.7.2), in that order. Could this be my problem ? I need the different versions for different plugins i am using for other things. Any ideas ?
I am totally stumped.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T02:53:12+00:00Added an answer on June 10, 2026 at 2:53 am

    Ok so this is what I had to do, looks like a very very fundimental mistake on my behalf.

                $(this).find('.itemcontrols button:nth-child(3)').button({
                    icons: {
                        primary: "ui-icon-closethick"
                    },
                    text: false
                }).unbind('click').click(function(){
                    $thislistitem.removeClass('focus').find('.itemcontrols').hide();
                    return false;
                });
    

    All i needed to do was add return false; after my logic. Hope it helps someone out there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using keyboard_key variable from here: //overrides the function keyPressed from lcdui.Canvas protected
Suppose I have a function: function test(){ //should I define global variable here //like
I'm trying to create a metaclass for the class I created here: ctypes variable
A similar question was asked here: PHP variable like $myvar-test is not valid? And
I have the contents of a web page assigned to a variable $html Here's
Here is my problem: in a variable that is text and contains commas, I
here is my sample html which is stored in a variable. var sHtml='' sHtml='<div
Here's what I'm doing (sorry for the variable names, I'm not using those in
Here's the code: //check if the starting row variable was passed in the URL
i hope that everyone here know the php 'variable variable' syntax: $color = 'red';

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.