frappe / datatable

The Missing Javascript Datatable for the Web
https://frappe.io/datatable
MIT License
991 stars 160 forks source link

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

Open luckyabhishek opened 9 months ago

luckyabhishek commented 9 months ago

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"
        }]```
d-miles commented 8 months ago

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
        }
    ]
anker9 commented 8 months ago

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

    }