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 750197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T14:31:24+00:00 2026-05-14T14:31:24+00:00

function init_exam_chooser(id,mode) { this.id=id; this.table=$(# + this.id); this.htmlRowOrder=<tr> + $(# + this.id + tbody

  • 0
function init_exam_chooser(id,mode)
{
    this.id=id;
    this.table=$("#" + this.id);

    this.htmlRowOrder="<tr>" + $("#" + this.id + " tbody tr:eq(0)").html() + "</tr>";
    this.htmlRowNew="<tr>" + $("#" + this.id + " tbody tr:eq(1)").html() + "</tr>";
    $("#" + this.id + " tbody tr").remove();

    //Arxikopoiisi
    var rowNew=$(this.htmlRowNew);

    rowNew.find("input[type='text']").eq(0).autocomplete({
        source: function (req,resp)
        {

            $.ajax({
                url: "/medilab/prototypes/exams/searchQuick",
                cache: false,
                dataType: "json",
                data:{codeName:req.term},
                success: function(data) {
                    resp(data);
                }
            });

        },
        focus: function(event,ui)
        {
            return false;
        },
        minLength :2

    });

    rowNew.find("input[type='text']").eq(1).autocomplete({
        source: function (req,resp)
        {

            $.ajax({
                url: "/medilab/prototypes/exams/searchQuick",
                cache: false,
                dataType: "json",
                data:{name:req.term},
                success: function(data) {
                    resp(data);
                }
            });

        },
        focus: function(event,ui)
        {
            return false;
        },

        minLength :2
    });
    rowNew.find("input[type='text']").bind( "autocompleteselect", function(event, ui) {
        alert(htmlRowOrder);
        var row=$(htmlRowOrder);

        $(table).find("tbody tr:last").before(row);
        alert(ui.item.id);
});
    rowNew.appendTo($(this.table).find("tbody"));


//this.htmlRowNew

}

The problem is at ,how i can access htmlRowOrder?
I tried this.htmlRowOrder and didnt work….
Any ideas??

rowNew.find("input[type='text']").bind( "autocompleteselect", function(event, ui) {
            alert(htmlRowOrder);
            var row=$(htmlRowOrder);

            $(table).find("tbody tr:last").before(row);
            alert(ui.item.id);
    });
  • 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-05-14T14:31:25+00:00Added an answer on May 14, 2026 at 2:31 pm

    Your issue is that this is not what you think it is inside your event handlers. Most jQuery event handlers run in the context of the element on which the event was triggered; what that means is that inside the event handler, this is the element on which the event was triggered.

    You can solve this problem either by waiting for the next revision of JavaScript, which will have Function.prototype.bind baked in, or by setting a reference to your scope object outside the event handler and referring to it inside, similarly to patrick’s answer.

    function(){
        var instance = this;
        this.foo = "abc123";
        $('someselector').click(function(ev){
            this.foo; //causes an error; foo is now the element matching 'someselector'
            instance.foo; //this returns "abc123"
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

function main() { Hello(); } function Hello() { // How do you find out
function Obj1(param) { this.test1 = param || 1; } function Obj2(param, par) { this.test2
public function init(){ $this->view->user = Zend_Auth::getInstance()->getIdentity(); $this->view->siteName = Zend_Registry::get('config')->site->name; $this->view->menu = $this->_helper->generateMenu(Zend_Auth::getInstance()->getIdentity()); $this->view->slogan =
Here is my code: function init(){ $.get(URL, function(data) { DATA = data; var srcWithHead
I have got the following very simple code: function init() { var articleTabs =
<?php class Form_Audience extends Zend_Form_SubForm { public function init() { $this->setMethod('post'); $this->setLegend('Audience Details'); $this->addElement('text',
Dev-cpp comes with an example program Jackpot, which has a GetResults function in it:
function returnsAnArray () { return array ('test'); } echo returnsAnArray ()[0]; generates a syntax
Function FillAdminAccount() As Boolean FillAdminAccount = True Try SQLconn.ConnectionString = connect timeout=9999999; & _
function Submit_click() { if (!bValidateFields()) return; } function bValidateFields() { /// <summary>Validation rules</summary> ///

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.