diff --git a/concepts/05 UI Components/DataGrid/15 Columns/10 Column Types/5 AI Columns/00 AI Columns.md b/concepts/05 UI Components/DataGrid/15 Columns/10 Column Types/5 AI Columns/00 AI Columns.md new file mode 100644 index 0000000000..3e9280250c --- /dev/null +++ b/concepts/05 UI Components/DataGrid/15 Columns/10 Column Types/5 AI Columns/00 AI Columns.md @@ -0,0 +1 @@ +AI columns augment {WidgetName} data with AI-generated insights. You can add one or multiple AI columns to a {WidgetName}. AI columns are a type of [command column](/Documentation/Guide/UI_Components/DataGrid/Columns/Column_Types/Command_Columns/) and are not bound to a data field. \ No newline at end of file diff --git a/concepts/05 UI Components/DataGrid/15 Columns/10 Column Types/5 AI Columns/05 Add an AI Column.md b/concepts/05 UI Components/DataGrid/15 Columns/10 Column Types/5 AI Columns/05 Add an AI Column.md new file mode 100644 index 0000000000..0cb5c18bfc --- /dev/null +++ b/concepts/05 UI Components/DataGrid/15 Columns/10 Column Types/5 AI Columns/05 Add an AI Column.md @@ -0,0 +1,8 @@ +To add an AI column to {WidgetName}, follow these steps: + +- Define [aiIntegration](/Documentation/ApiReference/UI_Components/dxDataGrid/Configuration/#aiIntegration) (or **columns[]**.**ai**.[aiIntegration](/Documentation/ApiReference/UI_Components/dxDataGrid/Configuration/columns/ai/#aiIntegration) to configure AI settings specific to a column). +- Set a column's [type](/Documentation/ApiReference/UI_Components/dxDataGrid/Configuration/columns/#type) to *"ai"*. +- Specify the AI column's [name](/Documentation/ApiReference/UI_Components/dxDataGrid/Configuration/columns/#name). +- Configure **columns[]**.**ai** options, including [mode](/Documentation/ApiReference/UI_Components/dxDataGrid/Configuration/columns/ai/#mode), predefined [prompt](/Documentation/ApiReference/UI_Components/dxDataGrid/Configuration/columns/ai/#prompt), and [noDataText](/Documentation/ApiReference/UI_Components/dxDataGrid/Configuration/columns/ai/#noDataText) (displayed when the AI service returns no data for a row). + +[note] Specify [keyExpr](/Documentation/ApiReference/UI_Components/dxDataGrid/Configuration/#keyExpr) or implement key fields within the component [dataSource](/Documentation/ApiReference/UI_Components/dxDataGrid/Configuration/#dataSource) (for instance, **ArrayStore**.[key](/Documentation/ApiReference/Data_Layer/ArrayStore/Configuration/#key)) to ensure AI columns function correctly. \ No newline at end of file diff --git a/concepts/05 UI Components/DataGrid/15 Columns/10 Column Types/5 AI Columns/10 Limit Data Passed to the AI Service.md b/concepts/05 UI Components/DataGrid/15 Columns/10 Column Types/5 AI Columns/10 Limit Data Passed to the AI Service.md new file mode 100644 index 0000000000..cd1524a486 --- /dev/null +++ b/concepts/05 UI Components/DataGrid/15 Columns/10 Column Types/5 AI Columns/10 Limit Data Passed to the AI Service.md @@ -0,0 +1,76 @@ +Default AI requests include all data from rows visible in the {WidgetName} container. This data includes fields of hidden columns and fields not bound to a column. To save AI resources, you can configure the component to include only relevant data fields. Modify the **AIColumnRequestCreatingEvent**.[data](/Documentation/25_2/ApiReference/UI_Components/dxDataGrid/Types/AIColumnRequestCreatingEvent/#data) parameter within [onAIColumnRequestCreating](/Documentation/ApiReference/UI_Components/dxDataGrid/Configuration/#onAIColumnRequestCreating) as follows: + +--- + +##### jQuery + + + $('#{widget-name}-container').dx{WidgetName}({ + onAIColumnRequestCreating(e) { + e.data = e.data.map((item) => ({ + ID: item.ID, + // ... + })); + }, + }); + +##### Angular + + + + + + import { Dx{WidgetName}Module, type Dx{WidgetName}Types } from 'devextreme-angular/ui/{widget-name}'; + + export class AppComponent { + handleAIColumnRequestCreating(e: Dx{WidgetName}Types.AIColumnRequestCreatingEvent) { + e.data = e.data.map((item) => ({ + ID: item.ID, + // ... + })); + } + } + +##### Vue + + + + + + +##### React + + + import { {WidgetName}, type {WidgetName}Types } from 'devextreme-react/{widget-name}'; + + function handleAIColumnRequestCreating(e: {WidgetName}Types.AIColumnRequestCreatingEvent) { + e.data = e.data.map((item) => ({ + ID: item.ID, + // ... + })); + }; + + function App() { + return ( + <{WidgetName} ... + onAIColumnRequestCreating={handleAIColumnRequestCreating} + /> + ); + }; + +--- diff --git a/concepts/05 UI Components/DataGrid/15 Columns/10 Column Types/5 AI Columns/15 AI Column Limitations.md b/concepts/05 UI Components/DataGrid/15 Columns/10 Column Types/5 AI Columns/15 AI Column Limitations.md new file mode 100644 index 0000000000..ad6c40d007 --- /dev/null +++ b/concepts/05 UI Components/DataGrid/15 Columns/10 Column Types/5 AI Columns/15 AI Column Limitations.md @@ -0,0 +1,66 @@ +Note the following AI column limitations: + +- AI columns cannot be integrated within [band columns](/Documentation/Guide/UI_Components/DataGrid/Columns/Column_Types/Band_Columns/). +- {WidgetName} does not save AI-generated values to the component data source and does not support AI data editing, filtering, searching, and sorting. +- AI columns ignore the following [columns[]](/Documentation/ApiReference/UI_Components/dxDataGrid/Configuration/columns/) properties: + + + + + + + + +
+
    +
  • allowEditing
  • +
  • allowExporting
  • +
  • allowFiltering
  • +
  • allowGrouping
  • +
  • allowHeaderFiltering
  • +
  • allowSearch
  • +
  • allowSorting
  • +
  • autoExpandGroup
  • +
  • buttons[]
  • +
  • calculateCellValue
  • +
+
+
    +
  • calculateFilterExpression
  • +
  • calculateGroupValue
  • +
  • calculateSortValue
  • +
  • columns
  • +
  • dataField
  • +
  • dataType
  • +
  • editCellTemplate
  • +
  • editorOptions
  • +
  • falseText
  • +
  • filterOperations
  • +
+
+
    +
  • filterType
  • +
  • filterValue
  • +
  • filterValues
  • +
  • format
  • +
  • formItem
  • +
  • groupCellTemplate
  • +
  • groupIndex
  • +
  • headerFilter
  • +
  • isBand
  • +
  • lookup
  • +
+
+
    +
  • ownerBand
  • +
  • selectedFilterOperation
  • +
  • setCellValue
  • +
  • showEditorAlways
  • +
  • showWhenGrouped
  • +
  • sortIndex
  • +
  • sortingMethod
  • +
  • sortOrder
  • +
  • trueText
  • +
  • validationRules
  • +
+
\ No newline at end of file