Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/backbone.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 检查是否编辑了backgrid单元格_Jquery_Backbone.js_Editor_Cell_Backgrid - Fatal编程技术网

Jquery 检查是否编辑了backgrid单元格

Jquery 检查是否编辑了backgrid单元格,jquery,backbone.js,editor,cell,backgrid,Jquery,Backbone.js,Editor,Cell,Backgrid,我只想检查是否有其他方法来检查单元格是否已编辑。现在这里是我的代码片段。这是一个自定义单元编辑器 Backgrid.CustomDateCell = Backgrid.DateCell.extend({ editor: Backgrid.InputCellEditor.extend({ attributes: { type: "text" }, events: {}, initialize: fu

我只想检查是否有其他方法来检查单元格是否已编辑。现在这里是我的代码片段。这是一个自定义单元编辑器

Backgrid.CustomDateCell = Backgrid.DateCell.extend({
    editor: Backgrid.InputCellEditor.extend({
        attributes: {
            type: "text"
          },
        events: {},
        initialize: function(){
            Backgrid.InputCellEditor.prototype.initialize.apply(this, arguments);
            var _input = this;
            $(this.el).prop('readonly', true);
            $(this.el).datepicker({
                autoclose: true,
                todayHighlight: true,
                format: "mm/dd/yyyy",
                viewMode: "months",
                minViewMode: "months"
            });
            $(this.el).on('hide', function(e){
                var command = new Backgrid.Command({});
                _input.model.set(_input.column.get("name"), e.date);
                _input.model.trigger("backgrid:edited", _input.model, _input.column, command);
                command = _input = null;

                $(this).parent('td').addClass('cell-edited');
            });
        }
    })
});
我选择当前datetimepicker的父td并添加新类的最后一部分不起作用。当我试图找到一个解决方案来实现这一点时,我只想知道backgrid是否已经有了更好的方法来检查单元格是否已被编辑


提前感谢

我通过在自定义单元格的初始化中添加一个侦听器,使我的代码以某种方式工作

this.listenTo(_input.model, "backgrid:edited", function(){
                $(this.el).parent().parent().addClass('cell-edited');
            });
我仍然对我最初的要求持开放态度

谢谢