JavaScript/jQuery TreeList - AIColumnRequestCreatingEvent
The argument type in the aIColumnRequestCreating event.
Used in:
additionalInfo
Additional data to include in the request.
Use this object to specify additional data required by AI endpoints. For example, you can add metadata and query parameters.
data
TreeList data included in the AI request.
The default TreeList behavior is to include all data from visible rows in AI requests, including data not bound to a column and data of hidden columns. This gives LLMs broader context, but increases the component's use of AI resources. To save AI credits, you can modify this parameter to limit the data included in AI requests:
jQuery
$('#tree-list-container').dxTreeList({
onAIColumnRequestCreating(e) {
e.data = e.data.map((item) => ({
ID: item.ID,
// ...
}));
},
});Angular
<dx-tree-list ...
(onAIColumnRequestCreating)="handleAIColumnRequestCreating($event)"
></dx-tree-list>
import { DxTreeListModule, type DxTreeListTypes } from 'devextreme-angular/ui/tree-list';
export class AppComponent {
handleAIColumnRequestCreating(e: DxTreeListTypes.AIColumnRequestCreatingEvent) {
e.data = e.data.map((item) => ({
ID: item.ID,
// ...
}));
}
}Vue
<template>
<DxTreeList ...
:on-a-i-column-request-creating={handleAIColumnRequestCreating}
/>
</template>
<script setup lang="ts">
import { DxTreeList, type DxTreeListTypes } from 'devextreme-vue/tree-list';
function handleAIColumnRequestCreating(e: DxTreeListTypes.AIColumnRequestCreatingEvent) {
e.data = e.data.map((item) => ({
ID: item.ID,
// ...
}));
};
</script>React
import { TreeList, type TreeListTypes } from 'devextreme-react/tree-list';
function handleAIColumnRequestCreating(e: TreeListTypes.AIColumnRequestCreatingEvent) {
e.data = e.data.map((item) => ({
ID: item.ID,
// ...
}));
};
function App() {
return (
<TreeList ...
onAIColumnRequestCreating={handleAIColumnRequestCreating}
/>
);
};If you have technical questions, please create a support ticket in the DevExpress Support Center.