List views - Adjusting/Changing column width

Continuing the discussion from Supplier quotations list view - Wrong "Grand Total" currency symbol and/or value:

Getting off-topic, so starting a new thread…

I’m trying now to customize list views (particularly “Supplier Quotation” form) to show other columns.

Starting off “Buying > Supplier quotation” screen, I click on “Menu > Customize” and am headed to “Customize form” screen, with “Supplier Quotation” pre-selected as “Enter Form Type”. So far, so good…

As suggested by saurabh6790, under “Fields” section I click on desired field and on the pop-up form, I enable “In list view” check.

I would like to show two extra columns:

  • total
  • base_total
    so I enable this checkbox in both.

Click save, reload the page, but unfortunately only total field is shown:

No other field has “In list view” enabled (I verified all 68 rows) other than those two. So I assume all other columns in the list are “default” values that cannot be enabled/disabled through GUI.

From reading other threads I believe the problem is simply both columns won’t fit, so frappe shows the one with higher priority (I assume total is chosen because it’s higher in the “Fields” list than base_total… am I right?).

I tried changing field width in both columns, no luck. So, a few questions about that:

  • What’s the unit for the width field? px? %?
  • Do I need to write the units? Or just the values?
  • Do I need to set width for all columns that will be displayed (even those that are “default” fields)? Or those fields that don’t get a value are automatically fit?

Thanks!

1 Like

Please look at the coldwidths here :

Thanks
Syed

1 Like

Thanks @sdqadeer44!

I’m not sure I understand, though…

This code snippet you’re linking is “only” an example, is it? I mean: the code itself is not relevant to your advice, right? (otherwise I’m badly lost :confused: )

Assuming that’s correct, I tried writing on the width field of the editing form GUI:

  • {“subject”: 6}
  • “subject”: 6
  • 6
  • 1

Neither worked… Always the same list format displayed :unamused:

@abelinux,

Did you find solution to this problem? I am also hitting my head with this :tired_face:

You can change the “column” attribute per field by editing the doctype. :slight_smile:

Hi Little,

Can you explain on how to do the mentioned change in doctype? All the doctype attributes are disabled and I am not able to do any change.

Regards

Hi @fasilkaks, is your site currently on developer mode? I think you need to edit your site_config.json file and "add developer_mode": 1 . :slight_smile:

@Hera, unfortunately mine is a production server. Do the change is .json file effect the next update?

Yes they probably get changed after you update. The proper way if you want to customize is that you need to have a custom app which you are going to edit in your local/vm

1 Like

@littlehera
If I need to change the width of the column from doctype settings (and the developer_mode: 1), by default: how much the column width?
Why I am asking this? I need to display more columns in the list view and I need to reduce the column width so I can display more columns, is it possible?
By the way: whatever I place in the columns and in the width, the result at the list view is the same, why?
The developer_mode is 1 in both files: common_site_config.json (under sites) and site_config.json (under the site1.local).
Hopefully I can find help.
Regards
Bilal

@bghayad, If you need to change the column width in list view, you’ll need to change adjust the colwidths attribute in the js file as mentioned above by @sdqadeer44 [List views - Adjusting/Changing column width - #2 by sdqadeer44].

I think the listview width is still a Frappe/ERPNext issue which needs addressing. You can leave a like or your comment on this one at: Limited Space in List View · Issue #52 · frappe/manual_erpnext_com · GitHub

1 Like

Hello @littlehera and @sdqadeer44
Thanks a lot for the kindly help.

I tried to do changes to the purchase_order_list.js, but I do not see any changes in the column width and I do not see that I am able to add more columns whatever I placed the column width in the js file.

It is very important and very urgent to add more columns in the list view.
In the doctype, I checked (selected) the list view for the required fields to be shown in the list view, but still they are not appearing (regardless of what the colwidths is placed for the fields).

My question certainly is: to display more columns in the list view, what is the colwidths that I have to place in the doctype_list_view.js file?

Appreciate the kindly help and reply because really it is very important to resolve this issue.

Regards
Bilal

1 Like

It is possible to add more columns to the list via list_render.js and thanks a lot for @joelios who advised us:

Regards
Bilal

1 Like