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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:37:08+00:00 2026-05-23T11:37:08+00:00

I’ve created a table generated from my SQL DB of patches in my current

  • 0

I’ve created a table generated from my SQL DB of “patches” in my current “package” for this web page shown here :

<table id="PatchTable">
                <tr>
                    <th>
                        Name
                    </th>
                    <th>
                        Date
                    </th>
                    <th>
                        Detach
                    </th>
                    <th>
                        Evironment
                    </th>
                    <th>
                        Platform
                    </th>
                    <th>
                    </th>
                </tr>
                @{DeploymentMVC.Models.DeploymentDb db = new DeploymentMVC.Models.DeploymentDb();
                  DeploymentMVC.Models.Patch[] patches = db.GetPatches(Model);
                }
                @foreach (var patch in patches)
                {
                    <tr id=@string.Format("patch_{0}", patch.PatchID)>
                        <td class="NameDisplay">
                            @Html.DisplayFor(ptch => patch.PatchName)
                        </td>
                        <td class="DateDisplay">
                            @Html.DisplayFor(ptch => patch.PatchDate)
                        </td>
                        <td>
                            <input type="hidden" name="pkgID" class="pkgID" value="@Model.PackageID" />
                            <input type="checkbox" class="patchIds" name="patchIdString" value="@patch.PatchID" />
                        </td>
                        <td>
                            <div id=@string.Format("environment_{0}", patch.PatchID)>
                                @patch.Environment
                            </div>
                            <div class="hidden" id=@string.Format("SelectEnvironment_{0}", patch.PatchID) >
                                <select name="DeploymentOption" id=@string.Format("EnvironmentValue_{0}", patch.PatchID)>
                                    <option value="Staging">Staging</option>
                                    <option value="Live">Live</option>
                                </select>
                            </div>
                        </td>
                        <td>
                            @*TODO: Figure out deploy options*@
                            <div id=@string.Format("platform_{0}", patch.PatchID)>
                                @patch.Platform
                            </div>
                            <div class="hidden" id=@string.Format("SelectPlatform_{0}", patch.PatchID)>
                                <select name="Staging Servers" id=@string.Format("PlatformValue_{0}", patch.PatchID)>
                                    <option value="air-cast">air-cast</option>
                                    <option value="redshop">Redshop</option>
                                </select>
                            </div>
                        </td>
                        <td>
                            <div class="EditButton">
                                <input type="button" class="button EditButtonInput" value="" id=@string.Format("edit_{0}", patch.PatchID) />
                            </div>
                            <div class="SaveButton">
                                <input type="button" class="button SaveButtonInput hidden" value="" id=@string.Format("save_{0}", patch.PatchID) />
                            </div>
                        </td>
                    </tr>
                }
            </table>

And then I have another table of non-allocated “patches” that can be added to my table above ^ via a checkbox and submit button. Shown here:

<table id="newPatchTable" class="sortable">
                        <tr>
                            <th>
                                <div class="pointer">
                                    Name
                                </div>
                            </th>
                            <th>
                                <div class="pointer">
                                    Date
                                </div>
                            </th>
                            <th>
                                Location
                            </th>
                            <th>
                            </th>
                        </tr>
                        @{
                            DeploymentMVC.Models.Patch[] patchArray = DeploymentMVC.Models.DirectoryHelper.GetAllPatches();
                        }
                        @if (patchArray.Length != 0)
                        {
                            foreach (var patch in patchArray)
                            {
                            <tr id=@string.Format("addPatch_{0}", patch.PatchName.Replace(@" ", string.Empty))>
                                <td class="NameDisplay">
                                    @Html.DisplayFor(modelItem => patch.PatchName)
                                </td>
                                <td class="DateDisplay">
                                    @Html.DisplayFor(modelItem => patch.PatchDate)
                                </td>
                                <td class="LocationDisplay">
                                    @Html.DisplayFor(modelItem => patch.PatchLocation)
                                </td>
                                <td>
                                    <input type="checkbox" name="patchNames" class="PatchNames" value="@patch.PatchName" />
                                </td>
                            </tr>
                            }
                        }
                        else
                        {
                            <tr>
                                <td>
                                    <div>
                                        <a>There are no current patches to add to your package. Please go to the @Html.ActionLink("Deploy Packages", "DeployPackages", "Package")
                                            page to see packages or refresh the page if you recently committed a change are
                                            expecting a patch to show up here. </a><a href="sf-build:8080">Click here to go to TeamCity
                                                to manually build your patch.</a>
                                    </div>
                                </td>
                            </tr>
                        }
                    </table>

I have currently written some javascript to remove the selected “patches” (rows) from my un-allocated patch table (table 2), and added them to the package’s patch table (table 1). I know this is not the correct way to do so, but I could not figure out how to use clone() and be able to edit the id, class, and text of each <tr>, <td>, and <div>.

Here is my JS (I’ve removed some things because I don’t think they are necessary for my question):

$('#AddSelectedPatches').click(function () {
        ...
            $.each($('.PatchNames:checked'), function (i, element) {
             ...
                                                //Creates row in the package's "Patches" table
                                                var newRow = '<tr id=patch_' + patchID + '>'
                                                                 + '<td class="NameDisplay">' + patchName + '</td>'
                                                                 + '<td class="DateDisplay">' + patchDate + '</td>'
                                                                 + '<td><input type="hidden" name="pkgID" class="pkgID" value=' + $('#pkgID').val() + '/>'
                                                                 + '<input type="checkbox" class="patchIds" name="patchIdString" value=' + patchID + ' /></td>'
                                                                 + '<td><div id=environment_' + patchID + '>' + patchEnvironment + '</div>'
                                                                 + '<div class="hidden" id=SelectEnvironment_' + patchID + '><select name="DeploymentOption" id="EnvironmentValue_" + patch.PatchID>'
                                                                 + '<option value="Staging">Staging</option><option value="Live">Live</option></select></div></td>'
                                                                 + '<td><div id=platform_' + patch.PatchID + '>' + patchPlatform + '</div>'
                                                                 + '<div class="hidden" id=SelectPlatform_' + patchID + '>'
                                                                 + '<select name="Staging Servers" id="PlatformValue_" + patch.PatchID><option value="1">air-cast</option>'
                                                                 + '<option value="2">Redshop</option></select></div></td><td><div class="EditButton"><input type="button" class="button EditButtonInput" value="" id=edit_' + patchID + ' />'
                                                                 + '</div><div class="SaveButton"><input type="button" class="button SaveButtonInput hidden" value="" id=save_' + patchID + ' />'
                                                                 + '</div></td></tr>';
                                                $('#PatchTable').append(newRow);
                                                //Removes row in "New Patches to Add" table
                                                var patchName_noSpaces = patchName.replace(/\s/g, '')

                                                $('#addPatch_' + patchName_noSpaces).remove();
                                            });
        return false;
    });

This works for visually adding the patches (and my checkboxes work), but my EditButtonInput and hidden SaveButtonInput classes do not recognize the javascript created rows (i.e. my click events for those two classes do nothing when the JS created ones are clicked). I’ve checked for spelling mistakes but did not come across any that would cause this problem.

Please let me know if my question is not clear. 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-05-23T11:37:08+00:00Added an answer on May 23, 2026 at 11:37 am

    Men this is no the better way of doing this stuff.

    I recommend you tu use 2 connected list using jquery, is so simple!!!(http://jqueryui.com/demos/sortable/#connect-lists)

    And then as Senad pointed you must use .live for elements in the dom that are not created when it loads.

    Hope this help.

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
this is what i have right now Drawing an RSS feed into the php,
Seemingly simple, but I cannot find anything relevant on the web. What is the

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.