AI Assistant: DataGrid - write JQuery demo#33562
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new DataGrid “AI Assistant” demo entry and implements the jQuery version of the demo, integrating DevExtreme’s aiIntegration with an Azure OpenAI-backed chat-completions endpoint.
Changes:
- Added “AI Assistant” demo metadata under AI-powered Extensions → Data Grid and updated the existing DataGrid demo entry to use the “AI” badge and OpenAI module metadata.
- Added a new jQuery demo implementation (
index.js) that wiresdxDataGrid.aiAssistantto anAIIntegrationinstance and provides suggestion prompts. - Added the jQuery demo HTML page (
index.html) with required DevExtreme + AI integration scripts and OpenAI ESM import.
Reviewed changes
Copilot reviewed 3 out of 5 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| apps/demos/menuMeta.json | Registers/updates the DataGrid “AI Assistant” demo in the demos navigation metadata. |
| apps/demos/Demos/DataGrid/AIAssistant/jQuery/index.js | Implements the jQuery DataGrid AI Assistant demo logic and OpenAI request handling. |
| apps/demos/Demos/DataGrid/AIAssistant/jQuery/index.html | Adds the jQuery demo page and script/style dependencies for the AI Assistant demo. |
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 6 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (2)
apps/demos/Demos/DataGrid/AIAssistant/jQuery/index.js:76
prompt.system/prompt.userare optional inDevExpress.aiIntegration(can beundefined), but this demo passes them directly to OpenAI and also callsJSON.stringify(prompt.user).length. Ifprompt.userisundefined,JSON.stringifyreturnsundefinedand.lengththrows. Consider normalizing to empty strings (and using that normalized value for both the length check andaiPrompt).
sendRequest({ prompt, data }) {
const isValidRequest = JSON.stringify(prompt.user).length < 5000;
if (!isValidRequest) {
return {
promise: Promise.reject(new Error('Request is too long. Specify a shorter prompt.')),
abort: () => {},
};
}
const controller = new AbortController();
const signal = controller.signal;
const aiPrompt = [
{ role: 'system', content: prompt.system },
{ role: 'user', content: prompt.user },
];
apps/demos/Demos/DataGrid/AIAssistant/jQuery/index.js:58
getAIResponseRecursivealways waits 30s before retrying, even if the request was aborted during that delay. This makesabort()feel unresponsive and can keep the promise pending unnecessarily. Consider checkingsignal.abortedbefore/while waiting (and rejecting immediately), and guardingerror.messageaccess (it may be missing on non-Error throwables).
async function getAIResponseRecursive(messages, signal, responseSchema) {
return getAIResponse(messages, signal, responseSchema)
.catch(async (error) => {
if (!error.message.includes('Connection error')) {
return Promise.reject(error);
}
DevExpress.ui.notify({
message: 'Our demo AI service reached a temporary request limit. Retrying in 30 seconds.',
width: 'auto',
type: 'error',
displayTime: 5000,
});
await new Promise((resolve) => setTimeout(resolve, 30000));
return getAIResponseRecursive(messages, signal, responseSchema);
});
anna-shakhova
approved these changes
May 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.