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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:58:21+00:00 2026-06-13T20:58:21+00:00

So I am displaying graphs based on selection of checkboxes and have run into

  • 0

So I am displaying graphs based on selection of checkboxes and have run into a small problem.

I am currently looping through and selecting only the first graph, even when a select-all checkbox is checked – meaning I get however many amounts of the same first graph instead of the ten unique graphs.

As you will see in the code below, the previous line I was using that is commented out:

//var fnInstance=$('#counterTreeviewUL'+idTreeview)[0].children[i].children[0].attributes[1].value;

Works perfectly in Firefox ONLY – it displays all graphs correct etc. but does not work in Chrome/IE due to the way it is attempting to access elements.

I have replaced it with these two lines:

$el = $('#counterTreeviewUL'+idTreeview).first();
var fnInstance = $el.find("input").attr("onclick");

The two lines I have replaced it with cause everything to function in all three browsers (no errors in IE or Chrome anymore), however the only graph that is ever shown is the first one found – if three elements have been selected then 3 versions of the first graph will show instead of the 3 unique ones.

The full code is below, and console.logs of what the elements contain are below that:

for (var i=0;i<$('#counterTreeviewUL'+idTreeview)[0].children.length;i++)
{

 if (!$('#counterTreeviewUL'+idTreeview)[0].children[i].children[0].checked)
 {  
        $('#counterTreeviewUL'+idTreeview)[0].children[i].children[0].checked=true;


//var fnInstance=$('#counterTreeviewUL'+idTreeview)[0].children[i].children[0].attributes[1].value;

        $el = $('#counterTreeviewUL'+idTreeview).first();
        var fnInstance = $el.find("input").attr("onclick");


        fnInstance=fnInstance.substr(15).substr(0,fnInstance.length-2);

        var flagsInstance=fnInstance.split(new RegExp(","));

        var graph = {
                id: seqId,
                entityName: flags[6].substr(1).substr(0, flags[6].length - 2),
                entity: flags[5].substr(1).substr(0, flags[5].length - 2),
                idCounter: flags[4],
                counterName: flags[3].substr(1).substr(0, flags[3].length - 2),
                ivmanager: flags[7].substr(1).substr(0, flags[7].length - 2),
                chart: null,
                pointsToShowX: null,
                borneInf: null,
                unite: "",
                idInstance: flagsInstance[2].substr(1).substr(0, flagsInstance[2].length - 2),
                instanceName: flagsInstance[3].substr(1).substr(0, flagsInstance[3].length - 2),
                listPdsNull: new Array(),
                countInstance: idTreeview + "_" + i,
                countGraph: -1
            };

        seqId++;        
        graphs[graphsLastId]=graph;     
        graphsLastId++;
    }
}

Console.logs of elements:

enter image description here

Any help would be greatly appeciated as I have spent hours trying to work out (another previous employee’s) code..

I basically just need a browser-friendly version of this line –

 var fnInstance=$('#counterTreeviewUL'+idTreeview)[0].children[i].children[0].attributes[1].value;
  • 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-13T20:58:22+00:00Added an answer on June 13, 2026 at 8:58 pm

    Original:

    fnInstance=$('#counterTreeviewUL'+idTreeview)[0].children[i].children[0].attributes1.value;
    

    My suggestion:

    var changedIforPsedoSelctor = i+1;
    var nthChild = ":nth-child("+changedIforPsedoSelctor+")";
    var fnInstance = $('#counterTreeviewUL'+idTreeview).children(nthChild).children(":first-child").attr("onclick");
    

    I believe that should do it, however it would be much easier to answer your questions if you provided the HTML markup for this particular problem. I am also assuming that attributes[1] is equal to “onclick” in the selector.

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

Sidebar

Related Questions

I have deployed the munin, but the its not displaying any of the graphs.
I have a listView displaying a bunch of graphs. I can sort this listview
Displaying Type here to ... until the user enters text into a TextBox is
When displaying all articles of a specific month (given through the urls like this
I am displaying the iframe in wordpress page template. In iframe src i have
I am using liferay portal and displaying graphs on portlet... The manual says the
I am able to displaying multiple Y-axis using core plot, but my problem is
I'm trying to use the Dynamic Data Display (D3) library for displaying graphs in
In our C# .NET application we have two DirectShow filter graphs each showing a
I am displaying graph by capturing image and loading into a webView using loadHTMLString

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.