diff --git a/frappe/public/js/frappe/ui/listing.js b/frappe/public/js/frappe/ui/listing.js
index 31518fff2b..f5924ebc48 100644
--- a/frappe/public/js/frappe/ui/listing.js
+++ b/frappe/public/js/frappe/ui/listing.js
@@ -64,6 +64,20 @@ frappe.ui.Listing = Class.extend({
$.extend(this, this.opts);
$(this.parent).html(repl('\
+
\
\
%(title)s
\
\
@@ -120,6 +134,7 @@ frappe.ui.Listing = Class.extend({
if(this.show_filters) {
this.make_filters();
}
+ this.setup_docstatus_filter();
},
add_button: function(label, click, icon) {
if(this.appframe) {
@@ -213,6 +228,17 @@ frappe.ui.Listing = Class.extend({
});
},
+ setup_docstatus_filter: function() {
+ var me = this;
+ this.can_submit = frappe.model.is_submittable(me.doctype);
+ if(this.can_submit) {
+ $(this.parent).find('.show-docstatus').removeClass('hide');
+ $(this.parent).find('.show-docstatus input').click(function() {
+ me.run();
+ })
+ }
+ },
+
clear: function() {
this.data = [];
this.$w.find('.result-list').empty();
@@ -263,6 +289,11 @@ frappe.ui.Listing = Class.extend({
}
}
+ args.docstatus = this.can_submit ? $.map($(this.parent).find('.show-docstatus :checked'),
+ function(inp) {
+ return $(inp).attr('data-docstatus');
+ }) : []
+
// append user-defined arguments
if(this.args)
$.extend(args, this.args)
diff --git a/frappe/public/js/frappe/views/doclistview.js b/frappe/public/js/frappe/views/doclistview.js
index 86c9b0cf80..8621e5465b 100644
--- a/frappe/public/js/frappe/views/doclistview.js
+++ b/frappe/public/js/frappe/views/doclistview.js
@@ -57,25 +57,6 @@ frappe.views.DocListView = frappe.ui.Listing.extend({
'+__('Loading')+'...
')
.appendTo(this.$page.find(".layout-main-section"));
- $('')
- .appendTo(this.$page.find(".layout-side-section"));
-
this.$page.find(".layout-main-section")
.addClass("listview-main-section")
.parent().css({"margin-top":"-15px"});
@@ -93,7 +74,6 @@ frappe.views.DocListView = frappe.ui.Listing.extend({
this.meta = locals.DocType[this.doctype];
this.$page.find('.frappe-list-area').empty(),
this.setup_listview();
- this.setup_docstatus_filter();
this.init_list(false);
this.init_stats();
this.init_minbar();
@@ -149,19 +129,6 @@ frappe.views.DocListView = frappe.ui.Listing.extend({
this.appframe.add_help_button(this.meta.description);
}
},
- setup_docstatus_filter: function() {
- var me = this;
- this.can_submit = $.map(locals.DocPerm || [], function(d) {
- if(d.parent==me.meta.name && d.submit) return 1
- else return null;
- }).length;
- if(this.can_submit) {
- this.$page.find('.show-docstatus').removeClass('hide');
- this.$page.find('.show-docstatus input').click(function() {
- me.run();
- })
- }
- },
setup_listview: function() {
this.listview = frappe.views.get_listview(this.doctype, this);
this.wrapper = this.$page.find('.frappe-list-area');
@@ -252,16 +219,10 @@ frappe.views.DocListView = frappe.ui.Listing.extend({
this.listview.render(row, data, this);
},
get_args: function() {
- var docstatus_list = this.can_submit ? $.map(this.$page.find('.show-docstatus :checked'),
- function(inp) {
- return $(inp).attr('data-docstatus');
- }) : []
-
var args = {
doctype: this.doctype,
fields: this.listview.fields,
filters: this.filter_list.get_filters(),
- docstatus: docstatus_list,
order_by: this.listview.order_by || undefined,
group_by: this.listview.group_by || undefined,
}
diff --git a/frappe/public/js/frappe/views/listview.js b/frappe/public/js/frappe/views/listview.js
index 4ceb618202..144974bc58 100644
--- a/frappe/public/js/frappe/views/listview.js
+++ b/frappe/public/js/frappe/views/listview.js
@@ -246,6 +246,7 @@ frappe.views.ListView = Class.extend({
var col = $("")
.appendTo(body)
.addClass("col-sm-" + cint(colspan))
+ .addClass("col-xs-" + (cint(colspan) + 2))
.css({
"white-space": "nowrap",
"text-overflow": "ellipsis",
diff --git a/frappe/public/js/frappe/views/reportview.js b/frappe/public/js/frappe/views/reportview.js
index 07960f6bc0..b4bbad8b75 100644
--- a/frappe/public/js/frappe/views/reportview.js
+++ b/frappe/public/js/frappe/views/reportview.js
@@ -171,7 +171,6 @@ frappe.views.ReportView = frappe.ui.Listing.extend({
fields: $.map(this.columns, function(v) { return me.get_full_column_name(v) }),
order_by: this.get_order_by(),
filters: this.filter_list.get_filters(),
- docstatus: ['0','1','2'],
with_childnames: 1
}
},