frappe/datatable

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

luckyabhishek opened this issue · 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"
		}]```

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
		}
	]

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', 
      
    }