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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:13:07+00:00 2026-06-16T00:13:07+00:00

Having a bit of trouble getting my view to update on a drop event.

  • 0

Having a bit of trouble getting my view to update on a drop event. I’m pretty sure the problem is in the function handleDrop(). Re-rendering of the view has worked on normal model.set({}) tests in the browser. So, I know that is not where the problem lies…

The Backbone Router

App.Routers.Dashboard = Backbone.Router.extend({

routes: {
    "": "index"     
},

initialize: function(options) {

    },

index: function() {

var preflist = new App.Models.PrefList({});

preflist.fetch({
    success: function() {
      var paneloneview = new App.Views.PanelOne({ model: preflist });
      $('#panelone').html(paneloneview.render().$el);
    }  
});

var sourceID;
var payloads = {
poolpricedraggable: "poolprice",
nonedraggable: "smp"
};

var element = function(id) { return document.getElementById(id); }

function handleDragOver(event) {
if(event.preventDefault) event.preventDefault();
return false;
}
function handleDrop(event) {
    dropzone = this.id;
    if(event.preventDefault) event.preventDefault();
    console.log("recevied the data: " + payloads[sourceID] + " in #" + dropzone);
    var attribute = preflist.get('panel_one');
    preflist.set({panel_one: attribute});
    preflist.save();
}  

element('panelone').addEventListener('dragover', handleDragOver, false);            
element('panelone').addEventListener('drop', handleDrop, false);

The PanelOne View

App.Views.PanelOne = Backbone.View.extend({

initialize: function() {                
    _.bindAll(this, 'render');
    this.model.bind('change', this.render);
},

render: function(){
    var panelonesetting = this.model.get('panel_one');
    this.$el.html(JST['dashboard/' + panelonesetting]({}));
return this;
}

});

Kindest regards,
AC

  • 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-16T00:13:07+00:00Added an answer on June 16, 2026 at 12:13 am

    One problem I can see here is that you are trying to set the value of a model using the same value from itself – which basically gets ignored as you are replacing value with itself and change in the model doesn’t get detected – thus the render method is not being called.

    You might want to manually call the render or trigger change event on the model yourself using the trigger method on the model. (if there is anything else going on outside of the code you provided – cause with what I can see here nothing would change anyway?)

    Have you forgot to use information from the dragged object to alter settings of the model?

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

Sidebar

Related Questions

I'm having a bit of trouble getting the desired functionality from my function... Basically,
Im having a bit of trouble getting my JSON to be recognised by my
I'm having a bit of trouble getting my program to read in data from
I'm having a bit of trouble getting my form validation to work. As of
I'm having a bit of trouble getting my app to show up in the
I'm currently working with PowerPoint in VB.NET and having a bit of trouble getting
Having a bit of trouble wrapping my head around this one. I'm sure the
I'm having a bit of trouble with a a function that the mongodb c
Having a bit of trouble getting this right... The main objective is to have
I am having a bit of trouble getting my head around the following erlang

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.