Просмотр исходного кода

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

version-14
Anand Doshi 12 лет назад
Родитель
Сommit
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({ wn.ui.form.Controller = Class.extend({
init: function(opts) { init: function(opts) {
$.extend(this, 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); 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) { _f.FormGrid.prototype.move_row = function(up) {
if(!this.check_selected()) return; if(!this.check_selected()) return;


Загрузка…
Отмена
Сохранить