Ruby on rails 3.2 Netzke确认弹出窗口

Ruby on rails 3.2 Netzke确认弹出窗口,ruby-on-rails-3.2,netzke,Ruby On Rails 3.2,Netzke,在Netzke网格中删除记录时,要求确认。 我们如何为应用和保存操作实现相同的功能 谢谢。试试这个。该模型是带有国家代码和名称的简单国家表。重要的部分在js_configure方法中 class Countries < Netzke::Basepack::Grid def configure(c) super c.model = 'Country' c.persistence = true c.columns = [ { name: :co

Netzke网格中删除记录时,要求确认。
我们如何为应用和保存操作实现相同的功能


谢谢。

试试这个。该模型是带有国家代码和名称的简单国家表。重要的部分在
js_configure
方法中

class Countries < Netzke::Basepack::Grid

  def configure(c)
    super
    c.model = 'Country'
    c.persistence = true
    c.columns = [
      { name: :code, width: 100 },
      { name: :name, header: 'Country Name', width: 300 }
    ]
  end

  js_configure do |c|
    c.init_component = <<-JS
      function() {
        var t = this;
        t.callParent();

        t.onApply = (function() {
          t._onApply = t.onApply;
          return function() {
            Ext.Msg.confirm(t.i18n.confirmation,
            t.i18n.areYouSure, function(btn) {
              if (btn == 'yes') {
                t._onApply();
              }
            })
          }
        })();
      }
    JS
  end
end
class国家c、 init_component=感谢您的友好回复,并对延迟更新表示抱歉。除了将更改保存到数据库外,一切正常。对不起。我很忙,无法尽快回答。请检查修改后的答案。做得好!这对我来说很有效。谢谢你的大力支持