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

  • Home
  • SEARCH
  • 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 8473767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T17:26:34+00:00 2026-06-10T17:26:34+00:00

I’m in the need to convert excel macros into jquery code, the function is

  • 0

I’m in the need to convert excel macros into jquery code, the function is that you need to click on the plus sign to unfold and show the sub rows to modify column2 if you want to type values in column2, the other columns can’t be modified. You can’t straightly modify values of column2 until you unfold the parent row, because there are many sub rows belonging to parent row,say Car. The values of Name, Model, Code are existing, they are master data, no need to type or modify.

please see the snapshots :

enter image description here

enter image description here

Besides modifying values in sub rows , I need to be able to know which sub rows are modified and values of those rows.Initially the editable columns are blank. And when you click on the minus sign, the sub rows can be folded again,but the modified values won’t be lost,they are still there when unfolded again. One last requirement is it’s cross devices, the code must run well on pc,mobile phone,pad. Is that possible?

Many thanks.

  • 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-10T17:26:36+00:00Added an answer on June 10, 2026 at 5:26 pm

    You don’t need plugins to do that, this is commonly done using a few lines of simple code.

    DEMO : http://jsfiddle.net/FHWaw/2/

    In this demonstration, I specify on rows and cells an attribute identifying the “section” (the thing which can be opened or closed) :

    <table>
    <tr><td section-opener=mysection1 section-state=open> SOME HEADER </td></tr>
    <tr section-content=mysection1><td>some text</td><td>some other text</td></tr>
    <tr section-content=mysection1><td>some AAA</td><td>some zaaother text</td></tr>
    <tr section-content=mysection1><td>some text</td><td>some other text</td></tr>
    <tr><td section-opener=anothersection section-state=close> Hu ? </td></tr>
    <tr section-content=anothersection><td>some text</td><td>some other text</td></tr>
    <tr section-content=anothersection><td>some text</td><td>some other text</td></tr>
    </table>
    ​
    

    (in this sample, the first section is open at first while the second one is open)

    Then I have this which, on click, decides to change the class of the rows in order to let them be visible or not :

    $('body').on('click', 'td[section-opener]', function() {
        changeState($(this).attr('section-opener'));
    });
    
    changeState = function(sectionId, newstate) {
        var $opener = $('td[section-opener="'+sectionId+'"]');
        var oldstate = $opener.attr('section-state');
        if (oldstate==newstate) return newstate;
        newstate = oldstate=='open' ? 'close' : 'open'; // sanitization
        $opener.attr('section-state', newstate);
        $('tr[section-content="'+sectionId+'"]').attr('section-state', newstate);
        return newstate;
    };​
    

    And I have a CSS which mainly lets closed section be hidden (and the openers be clearly identifiable) :

    td[section-opener] {
        font-weight: bold;
        cursor: pointer;
    }
    td[section-opener][section-state="close"]:before {
        color: #ccc;
        content: " \25B6  ";
    }
    td[section-opener][section-state="close"]:hover:before{
        color: #aaa;
        content: " \25B6  ";
    }
    td[section-opener][section-state="open"]:before {
        content: "\25BC  ";
    }
    tr[section-content][section-state="close"] {
        display: none;
    }
    tr[section-content][section-state="open"] {
        display: table-row;
    }
    

    ​As nothing is never deleted, your edited input won’t be lost when closing and then opening again.

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

Sidebar

Related Questions

I need a function that will clean a strings' special characters. I do NOT
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace

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.