I'm having troubles trying to hide the ID column, auto-generated by Keystone List template. Is there a way to suppress this column? The documentation is pretty scant covering only basic usage of the framework.
            Asked
            
        
        
            Active
            
        
            Viewed 2,280 times
        
    1 Answers
12
            The ID column shows up when there isn't a "name" field that can be used to link to the details view in the Admin UI (or when the name field isn't being displayed).
You can't hide it, or rather we need something that can be used to attach the link to. You can, however replace it with any other name or text field using the map feature.
For example, if you wanted to use a key column as the "linking" / identifier property in your model:
var MyList = new keystone.List('MyList', {
  map: { name: 'key' }
});
MyList.add({
  key: String // this will be used wherever a "name" is required, instead of the ID
});
It's covered in the List Options in the docs.
        Jed Watson
        
- 20,150
 - 3
 - 33
 - 43
 
- 
                    1Thanks. I figured it out though. I found out that this would do also: MyList.mappings = { name: 'key' }; – Cristi Potlog Oct 21 '15 at 09:52
 - 
                    The List Options link you provided is throwing a 404. – FRMR Mar 19 '21 at 17:52