commonified code to set intro and footnote, removed print option from grid reports
This commit is contained in:
parent
872d32f6bb
commit
d7663ea789
3 changed files with 31 additions and 25 deletions
|
|
@ -306,31 +306,11 @@ _f.Frm.prototype.setup_footer = function() {
|
|||
}
|
||||
|
||||
_f.Frm.prototype.set_intro = function(txt) {
|
||||
if(!this.intro_area) {
|
||||
this.intro_area = $('<div class="alert form-intro-area" style="margin-top: 20px;">')
|
||||
.insertBefore(this.page_layout.body.firstChild);
|
||||
}
|
||||
if(txt) {
|
||||
if(txt.search(/<p>/)==-1) txt = '<p>' + txt + '</p>';
|
||||
this.intro_area.html(txt);
|
||||
} else {
|
||||
this.intro_area.remove();
|
||||
this.intro_area = null;
|
||||
}
|
||||
wn.utils.set_intro(this, this.page_layout.body, txt);
|
||||
}
|
||||
|
||||
_f.Frm.prototype.set_footnote = function(txt) {
|
||||
if(!this.footnote_area) {
|
||||
this.footnote_area = $('<div class="alert form-intro-area">')
|
||||
.insertAfter(this.page_layout.body.lastChild);
|
||||
}
|
||||
if(txt) {
|
||||
if(txt.search(/<p>/)==-1) txt = '<p>' + txt + '</p>';
|
||||
this.footnote_area.html(txt);
|
||||
} else {
|
||||
this.footnote_area.remove();
|
||||
this.footnote_area = null;
|
||||
}
|
||||
wn.utils.set_footnote(this, this.page_layout.body, txt);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -343,7 +323,7 @@ _f.Frm.prototype.setup_fields_std = function() {
|
|||
this.layout.addrow(); // default section break
|
||||
if(fl[0].fieldtype!="Column Break") {// without column too
|
||||
var c = this.layout.addcell();
|
||||
$y(c.wrapper, {padding: '8px'});
|
||||
$y(c.wrapper, {padding: '8px'});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -40,5 +40,32 @@ wn.utils = {
|
|||
} else {
|
||||
return list;
|
||||
}
|
||||
}
|
||||
},
|
||||
set_intro: function(me, wrapper, txt) {
|
||||
if(!me.intro_area) {
|
||||
me.intro_area = $('<div class="alert form-intro-area" style="margin-top: 20px;">')
|
||||
.insertBefore(wrapper.firstChild);
|
||||
}
|
||||
if(txt) {
|
||||
if(txt.search(/<p>/)==-1) txt = '<p>' + txt + '</p>';
|
||||
me.intro_area.html(txt);
|
||||
} else {
|
||||
me.intro_area.remove();
|
||||
me.intro_area = null;
|
||||
}
|
||||
},
|
||||
set_footnote: function(me, wrapper, txt) {
|
||||
if(!me.footnote_area) {
|
||||
me.footnote_area = $('<div class="alert form-intro-area" style="margin-top: 20px;">')
|
||||
.insertAfter(wrapper.lastChild);
|
||||
}
|
||||
|
||||
if(txt) {
|
||||
if(txt.search(/<p>/)==-1) txt = '<p>' + txt + '</p>';
|
||||
me.footnote_area.html(txt);
|
||||
} else {
|
||||
me.footnote_area.remove();
|
||||
me.footnote_area = null;
|
||||
}
|
||||
},
|
||||
}
|
||||
|
|
@ -309,7 +309,6 @@ wn.views.GridReport = Class.extend({
|
|||
</div>').appendTo(this.wrapper);
|
||||
|
||||
this.wrapper.find(".grid-report-export").click(function() { return me.export(); });
|
||||
this.wrapper.find(".grid-report-print").click(function() { msgprint("Coming Soon"); return false; });
|
||||
|
||||
// grid wrapper
|
||||
this.grid_wrapper = $("<div style='height: 500px; border: 1px solid #aaa; \
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue