Netzke Gridでは、レコードの削除中に確認を求められます。
適用アクションと保存アクションに同じことをどのように実装できますか。
ありがとう。
Netzke Gridでは、レコードの削除中に確認を求められます。
適用アクションと保存アクションに同じことをどのように実装できますか。
ありがとう。
これを試して。モデルは、国コードと国名を含む単純な国テーブルです。重要な部分は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