2013-05-28 54 views
0

Netzke網格雖然刪除記錄a 確認被問。
我們如何實現相同的應用和保存操作。Netzke確認彈出

謝謝。

回答

1

試試這個。該模型是簡單的國家表與國家代碼和名稱。重要的部分是在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 
+0

感謝您的回覆,並對後期更新感到抱歉。除了保存對數據庫的更改,一切都很好。 – ejo

+0

你能告訴我爲什麼db沒有更新嗎? – ejo

+0

對不起。我很忙,不能早點回答。 – Drazen