> For the complete documentation index, see [llms.txt](https://docs.dashboardjs.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dashboardjs.net/configuration-options/config/record-settings.md).

# Record Settings

```javascript
recordSettings:{
	// Renders an image for each record
	image: {
		url: 'imageURL',	// this is the key that is used to retrieve the URL from the supplied data  
		height: '200px',	// Height of the image in Card View
	},
	// On Click event for the entire record
	onClick: function (record) {
		alert("Record Clicked: record: " + JSON.stringify(record.data));
	},					
	fieldsGrid: {
		'grid-template-columns': '1fr 1fr',
		'gap': '15px',
		'justify-items': 'stretch'
	},
	fields: {
		// This is a collcation of value/key pair of objects describing the record fields
		// Each key maps to the key of the supplied data to retrieve the value of each field
		Date: { 	// This key name maps to the data 
			name: "Date of Birth", // Displayed Name of the field int he dashboard
			position: "left", 	// Position in the Card View
			dataType: "Date",  // This just formats and renders the date in a graphical way
			translation: { "ar-AE": "السن" } 
		},
		Status: { 
			name: "Marital Status", 
			position: "right", 
			dataType: "String", // Does nothing at the moment
			// Can use this to modify the data value before displaying it to the dashboard							
			onGetValue: function (field){	
				if (field.data == 'Married' && field.record['Gender']=='Female'){
					return '<span style="font-weight: bold;color: #72de72">' + field.data + '</span>';
				}else{
					return field.data;
				}
			},
			translation: { "ar-AE": "الحالة الزوجية" } 
		},
		Name: {
			name: "Name", 
			position: "left",	// Position in the Card View
			// This controls the visibility of the field.
			// Accepts 3 values: show, hide, disable
			visibility: function (field){
				// Checks to see if the name of this person contains the phrase (disabled) in the name, then disable this field
				// disable greys out the field and removes all actions on the field (including onClick)
				if (field.data.indexOf('(disabled)')>-1){
					return 'disable';
				}else{
					return 'show'
				}
			},
			onClick: function (element, record) {
				console.log("Field Clicked: element, data:", element, record);
			},
			translation: { "ar-AE": "الإسم" }
		},
		Gender: { 
			name: "Gender", 
			position: "right", 	// Position in the Card View
			dataType: "String", 
			translation: { "ar-AE": "الجنس" } 
		},
		Description: {
			position: "left",
			width: "400px",
			style:{
				'grid-column': 'span 2'
			},
			class: 'justify',
			onGetValue: function (item){
				// If there is no value
				if (!item.data){
					return '<span style="color: #c3c3c3">N/A</span>'
				}
			},
			translation: { "ar-AE": "الوصف" }
		}
	},
	// How should the actions appear? 
	// 'buttons' (default) displays the actions as buttons
	// 'menu' shows the action as a drop down menu
	actionsType: 'menu',
	actions: {
		"More details...": {
			icon: 'info-icon',
			translation: {
				'ar-AE': 'معلومات أخرى'
			},
			onClick: function(action){
				alert('Clicked More Info ... on record ' + JSON.stringify(action.record));
			}
		},
		"Pay": {
			icon: "pay-icon",
			translation: {
				'ar-AE': 'دفع'
			},
			visibility: function (actionObj) {
				// returns a string representing the visibility
				return "disable";
			},
			onClick: function(){
				alert('Clicked Pay!');
			}
		},
		"Edit": {
			icon: 'edit-icon',
			translation: {
				'ar-AE': 'تعديل'
			},
			onClick: function(){
				alert('Clicked Edit');
			}
		},
		"Cancel": {
			icon: 'cancel-icon',
			translation: {
				'ar-AE': 'إلغاء'
			},
			onClick: function(){
				alert('Clicked Cancel');
			}
		}
	}
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.dashboardjs.net/configuration-options/config/record-settings.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
