Ver a proveniência

Merge branch 'develop'

version-14
Nabin Hait há 9 anos
ascendente
cometimento
50a00e2740
4 ficheiros alterados com 45 adições e 6 eliminações
  1. +1
    -1
      frappe/__init__.py
  2. +3
    -0
      frappe/public/css/form_grid.css
  3. +37
    -5
      frappe/public/js/frappe/form/grid.js
  4. +4
    -0
      frappe/public/less/form_grid.less

+ 1
- 1
frappe/__init__.py Ver ficheiro

@@ -13,7 +13,7 @@ import os, sys, importlib, inspect, json
from .exceptions import *
from .utils.jinja import get_jenv, get_template, render_template

__version__ = "7.0.11"
__version__ = "7.0.12"

local = Local()



+ 3
- 0
frappe/public/css/form_grid.css Ver ficheiro

@@ -34,6 +34,9 @@
.form-grid .data-row.sortable-handle {
cursor: move;
}
.form-grid .template-row {
padding: 8px 15px;
}
.grid-body .data-row {
font-size: 12px;
}


+ 37
- 5
frappe/public/js/frappe/form/grid.js Ver ficheiro

@@ -37,10 +37,10 @@ frappe.ui.form.Grid = Class.extend({
allow_on_grid_editing: function() {
if(frappe.utils.is_xs()) {
return false;
} else if(this.editable_fields) {
} else if(this.meta.editable_grid) {
return true;
} else {
return this.meta.editable_grid;
return false;
}
},
make: function() {
@@ -552,7 +552,11 @@ frappe.ui.form.GridRow = Class.extend({
}
});

this.render_row();
if(this.grid.template && !this.grid.meta.editable_grid) {
this.render_template();
} else {
this.render_row();
}
if(this.doc) {
this.set_data();
}
@@ -600,13 +604,41 @@ frappe.ui.form.GridRow = Class.extend({
}
// re write columns
this.visible_columns = null;
this.render_row(true);

if(this.grid.template && !this.grid.meta.editable_grid) {
this.render_template();
} else {
this.render_row(true);
}

// refersh form fields
if(this.grid_form) {
this.grid_form.layout && this.grid_form.layout.refresh(this.doc);
}
},
render_template: function() {
if(this.row_display) {
this.row_display.remove();
}
var index_html = '';

// row index
if(this.doc) {
if(!this.row_index) {
this.row_index = $('<div style="float: left; margin-left: 15px; margin-top: 8px; \
margin-right: -20px;"></div>').appendTo(this.row);
}
this.row_index.html(this.doc.idx);
}

this.row_display = $('<div class="row-data template-row">'+
+'</div>').appendTo(this.row)
.html(frappe.render(this.grid.template, {
doc: this.doc ? frappe.get_format_helper(this.doc) : null,
frm: this.frm,
row: this
}));
},
render_row: function(refresh) {
var me = this;
this.set_row_index();
@@ -893,7 +925,7 @@ frappe.ui.form.GridRow = Class.extend({
hide_form: function() {
frappe.dom.unfreeze();
this.row.toggle(true);
this.render_row();
this.refresh();
cur_frm.cur_grid = null;
this.wrapper.removeClass("grid-row-open");
},


+ 4
- 0
frappe/public/less/form_grid.less Ver ficheiro

@@ -46,6 +46,10 @@
}
}

.form-grid .template-row {
padding: 8px 15px;
}

.grid-body .data-row {
font-size: 12px;
}


Carregando…
Cancelar
Guardar