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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:34:17+00:00 2026-06-09T11:34:17+00:00

I have the below Dojo DnD and I can’t figure out how to delete

  • 0

I have the below Dojo DnD and I can’t figure out how to delete and add item(s) from/to the catalog source. What I ultimately want to do is allow the users to is:

  1. Drag items from the catalog to the wishlist… this is working fine.
  2. Delete any remaining items in the catalog that were not moved to the wishlist by clicking the Clear List button… need help here.
  3. Be able to add new items to the catalog by clicking another button that is not listed in the below code… need help here.

To summarize, I need to know how to delete items and add items from/to the catalog, and have any moved items remain in the wishlist.

dojo.addOnLoad(function() {
    require([ "dojo/dom-class", "dojo/dnd/Source", "dijit/form/Button", "dojo/domReady!" ], function(domClass, Source){
        var catalog = new Source("catalogNode");
        catalog.insertNodes(false, [
            { data: "Bushmaster <div id='5' style='display:none;'>5</div>"},
            { data: "Colt <div id='4' style='display:none;'>4</div>"},
            { data: "DPMS <div id='6' style='display:none;'>6</div>"},
            { data: "Glock <div id='2' style='display:none;'>2</div>"},
            { data: "Kahr Arms <div id='7' style='display:none;'>7</div>"},
            { data: "Marlin <div id='3' style='display:none;'>3</div>"},
            { data: "Remington <div id='78' style='display:none;'>78</div>"},
            { data: "Rock River Arms <div id='1' style='display:none;'>1</div>"},
            { data: "Smith & Wesson <div id='105' style='display:none;'>105</div>"}
        ]);
        catalog.forInItems(function(item, id, map){
            domClass.add(id, item.type[0]);
        });

        var wishlist = new Source("wishlistNode");

        new dijit.form.Button({
            label: "Clear List",
            onClick: function() {
                alert("Clearing Items");
            }
        },
        "clearListBtn");
    });
});
  • 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-09T11:34:19+00:00Added an answer on June 9, 2026 at 11:34 am

    Delete all (remaining) elements in a source:

    // e.g., var catalog = new Source("catalogNode");
    catalog.selectAll().deleteSelectedNodes();
    

    New items can be added at any time by using the very same insertNodes():

    catalog.insertNodes(false, additionalData);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have below code: <a href=# id=@item.Id name=vote ><img src=/Content/images/021.png style=float:left alt= /></a> which
I have below string String str=select * from m_menus; select * from m_roles; I
I have below trigger ALTER TRIGGER [dbo].[DeleteUserData] ON [dbo].[site_users] AFTER DELETE AS BEGIN SET
I have below code in code behind for btnShowReport_Click : SqlDataSource1.SelectParameters.Clear(); SqlDataSource1.SelectParameters.Add(username, txtUsername.Text); SqlDataSource1.SelectParameters.Add(printer,
I have below updateFile code, here I am trying to add new node when
I have a Dojo-DataGrid which is programatically populated as below : var jsonStore =
I have below similar report in Jaspersoft iReport Designer, but not able to figure
How can I assign a variable to content attr of dojo.xhrPost dynamically ? Below
I have below code working as desired but the on select works only from
I have below structure <div class=mybox> <div id=imageslide> <a href=><img src=url /></a> </div> </div>

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.