datatable icon indicating copy to clipboard operation
datatable copied to clipboard

Sortable property on Column doesn't disable sorting options on UI

Open luckyabhishek opened this issue 1 year ago • 2 comments

Hi , I am using the datatable in the context of script report erpnext. I return a couple of columns for my report and I set the "sortable" property on the second one as false. But I still see that this column is sortable on the UI. is there something I am missing ?

This is what my config for column is

[
		{
			"fieldname": "lead_id",
			"fieldtype": "Link",
			"label": "Lead id",
			"options": "Lead",
			"width": 0
		},
		{
			"fieldname": "creation",
			"fieldtype": "Date",
			"label": "Lead Received Date",
			"sortable": "false"
		}]```

luckyabhishek avatar Oct 30 '23 04:10 luckyabhishek

You're using the string "false" rather than false. Try this instead:

	[
		{
			"fieldname": "lead_id",
			"fieldtype": "Link",
			"label": "Lead id",
			"options": "Lead",
			"width": 0
		},
		{
			"fieldname": "creation",
			"fieldtype": "Date",
			"label": "Lead Received Date",
			"sortable": false
		}
	]

d-miles avatar Nov 20 '23 15:11 d-miles

You're using the string "false" rather than false. Try this instead:

	[
		{
			"fieldname": "lead_id",
			"fieldtype": "Link",
			"label": "Lead id",
			"options": "Lead",
			"width": 0
		},
		{
			"fieldname": "creation",
			"fieldtype": "Date",
			"label": "Lead Received Date",
			"sortable": false
		}
	]

Same issue(( sortable:false doesn't work, and Sort Ascending,Sort Descending,Reset sorting,Remove column ar' still aviable Im using dat columns definition

 {name:'Status',
      id:'status',
      editable:false,
      sortable:false,
      width: 200, align: 'center', 
      
    }

anker9 avatar Nov 29 '23 22:11 anker9