backbone js brak przekierowania do innej podstrony

0

Gdy klikam w button powinno mi przekierować na podstrone: localhost:8000/list/jakies_id/edit a jednak tego nie robi..

(function () {
    APP.Views.List = Backbone.View.extend({
        tagName: "div",

        template: _.template($("#listTemp").html()),

        initialize: function () {
            this.listenTo(this.model, "sync", this.editNow);
            this.render();
        },

        render: function () {
            var html = this.template(this.model.toJSON());
            this.$el.html(html)
            APP.Regions.appContent.html(this.el)
            this.stickit();
        },

        bindings: {
            "#name": "name",
        },
        events: {
            "submit": "good",
        },
        good: function (e) {
            e.preventDefault();
            this.model.save({}, {
                wait: true
            })
        },
        editNow: function () {
            APP.router.navigate("list/" + this.model.get("_id") + "/edit", {
                trigger: true
            });

        }

    })
})();
1

Nie znam się na backbone i nie wiem, co robi twój kod, ale w JS byłoby to tak :)

<button onclick="window.location ='localhost:8000/list/jakies_id/edit';">pójdźmy stąd</button>

1 użytkowników online, w tym zalogowanych: 0, gości: 1