Giter Club home page Giter Club logo

meteor-delete-button's People

Contributors

aldeed avatar vhf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

meteor-delete-button's Issues

Exception in delivering result of invoking '/projects/remove':

Hi,

I'm using this package to remove objects from my collection "projects".

I have added the button like this :
{{#quickRemoveButton collection="Projects" _id=this._id onError=onError onSuccess=onSuccess beforeRemove=beforeRemove class="btn btn-xs btn-danger"}}

{{/quickRemoveButton}}

I have also authorized the remove function :
if (Meteor.isServer) {
Projects.allow({
remove: function (userId, doc) {
return true;
}
});

The project is deleted but it throws this exception :
Exception in delivering result of invoking '/projects/remove': ["click button"]/<.remove/<@http://meteor-128110.nitrousapp.com:3000/packages/aldeed_delete-button.js?5374a4599af02af385dd7a72d89f3c1f5fe70deb:118:13
Mongo.Collection.prototype[name]/wrappedCallback@http://meteor-128110.nitrousapp.com:3000/packages/mongo.js?3cfe0c5981c197df33036a37574850f057e934a6:621:9
Meteor.bindEnvironment/<@http://meteor-128110.nitrousapp.com:3000/packages/meteor.js?43b7958c1598803e94014f27f5f622b0bddc0aaf:983:17
._maybeInvokeCallback@http://meteor-128110.nitrousapp.com:3000/packages/ddp.js?d1840d3ba04c65ffade261f362e26699b7509706:3860:7
.dataVisible@http://meteor-128110.nitrousapp.com:3000/packages

Any idea ?

Thanks for your help

beforeRemove not called

Hi,

Not sure why this is happening, don't see any errors in the console. I have:

{{> quickRemoveButton beforeRemove=removeConfirm collection="Meteor.users" _id=this._id class="btn btn-danger"}}

and the following helper function:

Template.Users.helpers({
data: function() {
return Meteor.users.find();
},

removeConfirm: function() {
    return function(collection, id) {
        console.log("beforeremove");
        var doc = collection.findOne(id);
        if (confirm('Really delete user: "' + doc.name + '"?')) {
            this.remove();
            Router.go('users');
        }
    };
}

});

but the removeConfirm method is never called and I'm unable to see why its not being called.

Any suggestions?

Thanks,

Mark

Break the reactivity if the collection use ObjectID instead of String

The delete button works great with
Benchmarks = new Mongo.Collection('benchmarks', {idGeneration: 'STRING'});

Whenever I click the delete button, the associate data is deleted as expected, and the table will refresh reactively.

But if I have

Benchmarks = new Mongo.Collection('benchmarks', {idGeneration: 'MONGO'});

Whenever I click the delete button, the data is deleted since I got result 1 from on success hook. But the data won't disappear. and the table will not refresh itself. After I refresh the page manually, the deleted data will disappear.

soft delete?

Does it have option to use zimme:collection-softremovable instead of deleting?

Un-style

Hi,

Any way to do it not to look like a button? I would like it to show up just like an icon from an icon font :)

Thanks!

beforeRemove callback called for each row inside datatable

I'm using tabular and a template for a column that displays actions buttons:

screenshot - 08052015 - 01 04 42 pm

Tabular is initialized with the last column as a template:

{
      tmpl: Meteor.isClient && Template.actionCell,
      sWidth: "20px",
      sClass: "td-center",
}

Template is something like this:

<template name="actionCell">
        <div class="btn-group" role="group">
            <button id="{{this._id}}" type="button" class="btn btn-xs btn-primary" data-toggle="modal" data-target="#editEntryDialog"><i class="fa fa-edit"></i>
            </button>
            {{# quickRemoveButton collection="MyCollection" _id=this._id onError=onError onSuccess=onSuccess beforeRemove=beforeRemove class="btn btn-xs btn-danger"}}
            <i class="fa fa-trash"></i>
            {{/quickRemoveButton}}
        </div>
</template>

I wrote a simple helper to test the functionality:

  Template.actionCell.helpers({
    beforeRemove: function() {
      alert('a dialog');
    }
  });

When the datatable loads, the alert dialog gets invoked. I think this is due the case that the content block is rendered and so the helper is being called.

Is it possible to use the template as a content block and make use of callbacks?

Note: I'm sorry for the editions, I had a lot of troubles with my touchpad.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.