瀏覽代碼

call setup in wn.ui.form.Controller's init and added clear table method in form grid

version-14
Anand Doshi 12 年之前
父節點
當前提交
c74ad7c745
共有 2 個檔案被更改,包括 11 行新增0 行删除
  1. +1
    -0
      public/js/legacy/widgets/form/form.js
  2. +10
    -0
      public/js/legacy/widgets/form/form_grid.js

+ 1
- 0
public/js/legacy/widgets/form/form.js 查看文件

@@ -44,6 +44,7 @@ wn.provide('wn.ui.form');
wn.ui.form.Controller = Class.extend({
init: function(opts) {
$.extend(this, opts);
this.setup && this.setup();
}
});



+ 10
- 0
public/js/legacy/widgets/form/form_grid.js 查看文件

@@ -246,6 +246,16 @@ _f.FormGrid.prototype.delete_row = function(dt, dn) {
if(this.on_row_delete) this.on_row_delete(cur_frm.doc, dt, dn);
}

_f.FormGrid.prototype.clear_table = function() {
var me = this;
$.each(this.get_children(), function(i, d) {
wn.model.clear_doc(d.doctype, d.name);
if(me.on_row_delete) me.on_row_delete(cur_frm.doc, d.doctype, d.name);
});
this.refresh();
this.set_unsaved();
}

_f.FormGrid.prototype.move_row = function(up) {
if(!this.check_selected()) return;


Loading…
取消
儲存