在Netzke Grid中,删除记录时会询问确认。
如何为应用和保存操作实现相同的操作。
谢谢。
发布于 2013-05-29 14:35:27
尝尝这个。该模型是带有国家代码和名称的简单国家表。重要的部分是在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
endhttps://stackoverflow.com/questions/16790596
复制相似问题