Browse Source

Merge pull request #1249 from neilLasrado/develop

Multiple fixes
version-14
Anand Doshi 10 years ago
parent
commit
a1ea29a5b7
2 changed files with 18 additions and 0 deletions
  1. +10
    -0
      frappe/public/js/frappe/form/control.js
  2. +8
    -0
      frappe/public/js/frappe/form/grid.js

+ 10
- 0
frappe/public/js/frappe/form/control.js View File

@@ -119,6 +119,16 @@ frappe.ui.form.ControlHTML = frappe.ui.form.Control.extend({
},
html: function(html) {
this.$wrapper.html(html || this.get_content());
},
set_value: function(html) {
if(html.appendTo) {
// jquery object
html.appendTo(this.$wrapper.empty());
} else {
// html
this.df.options = html;
this.html(html);
}
}
});



+ 8
- 0
frappe/public/js/frappe/form/grid.js View File

@@ -53,6 +53,14 @@ frappe.ui.form.Grid = Class.extend({
var me = this,
$rows = $(me.parent).find(".rows"),
data = this.get_data();
if (this.frm && this.frm.docname) {
// use doc specific docfield object
this.df = frappe.meta.get_docfield(this.frm.doctype, this.df.fieldname, this.frm.docname);
} else {
// use non-doc specific docfield
this.df = frappe.meta.get_docfield(this.df.options, this.df.fieldname);
}

this.docfields = frappe.meta.get_docfields(this.doctype, this.frm.docname);
this.display_status = frappe.perm.get_field_display_status(this.df, this.frm.doc,


Loading…
Cancel
Save