How to implement delete per row for backgrid

后端 未结 2 1896
逝去的感伤
逝去的感伤 2021-02-04 20:43

I\'ve been trying to implement a \"delete\" button for backgrid rows. A solution seems to be described here:

How to add a custom delete option for backgrid rows

2条回答
  •  太阳男子
    2021-02-04 21:25

    You are getting an exception because your trying to call the function on the wrong view property. Backbone views have two different ways to access it's el, either directly in the DOM or as a jQuery object as follows:

    1. this.el - This is a direct reference to the DOM element.
    2. this.$el - The jQuery object for the DOM element.

    Its important to remember, that you need to call functions like append() and html() on the $el property as they are jQuery functions.

提交回复
热议问题