Refresh a particular div without reloading the page?


#1

how to refresh the just the ember-selectize div without reloading the whole page.


#2

If you update the author model ember-selectize will update without reloading the page. This seems to be the same bug as the ember-cli-pagination one. I think you somewhere have a Ember.computed filter or something that is not listening for change on the correct values. Try skipping this Ember.computed for the test.


#3

how should i update the author in the model.

my code—>

 {{ember-selectize
      multiple="true"
      filter="true" 
      remove-item="itemRemoved"
      content=roles
      name="roleIds"
      optionValuePath="content.id"
      optionLabelPath="content.name"      
      update-filter="roleFilterUpdate"
      add-item="selectedRole"
      selection=content.roleIds
      placeholder="--Select--"
      }}

export default Ember.Controller.extend({

 removedValue:[],
itemRemoved:function(removedItem){
        this.get('removedValue').push(removedItem.id);
    },
    Close: function() {  
       // console.log(">>"+this.get('content.roleIds'));
       let self = this;
       var array = [];
        var roleLength = self.get('content.roleIds');
        roleLength.forEach(function(roleeach) {
            array.push(roleeach.get('id'));
         });
        var finalValue = array.concat(this.get('removedValue'));
        self.set("roleLength",finalValue);
        self.get('model').rollbackAttributes();      
    }
  }

});

i dont want to update the value without saving . so, while saving i m retrieving all deleted values… how to get bck all the values???


#4

You can see this in action by going to in one browser to https://bloggr.exmer.com/ login and select edit on some post. Go in an other browser to https://bloggr.exmer.com/ login and add an Author. Go back to the first browser and see you Author there without reloading the page. I recommend not to use Safari for this test because it keeps asking for more storage memory. Edge, Chrome, Firefox, IE etc. are all fine.


#5

My example is with saving. Have not used the roleback options but values are updated without saving out of the box. Not sure I can help with this.