syntax checking & spell correction for GridJs

To perform syntax checking & spell correction on user input, the steps are:

Set load options.

For example:

 const option = {
     ...
     // set showCheckSyntaxButton to true
    showCheckSyntaxButton:true,
    // set checkSyntax to true
    checkSyntax:true,
 };
  xs = x_spreadsheet('#gridjs-demo', option)

Set action URL for syntax checking & spell correction.

For example:

 const checkurl = "/GridJs2/CheckSyntax";  
 xs.setSyntaxCheckUrl(checkurl);

After a user enters text content in a cell, the action of syntax checking will be triggered automatically by the spreadsheet application.

Implement syntax checking & spell correction action API in a controller on the server side.

For example:

 [HttpPost]
 public async Task<IActionResult> CheckSyntaxAsync()
 {   // the input text content 
     string text = HttpContext.Request.Form["v"];
     /* the locale info: support multiple languages for menus; the locale can be:
                            en, zh, es, pt, de, ru, nl,
                     for English, Chinese, Spanish, Portuguese, German, Russian, Dutch
                            ar, fr, id, it, ja,
                     for Arabic, French, Indonesian, Italian, Japanese
                            ko, th, tr, vi, cht
                     for Korean, Thai, Turkish, Vietnamese, Traditional Chinese
     */
     string locale = HttpContext.Request.Form["locale"];
     if (string.IsNullOrEmpty(text))
     {
         return Ok(new
         {
             Success = false,
             v = ""
         });
     }

     // The logic for invoking syntax checking here can be implemented through a third‑party library or custom logic.
     string correctedContent = await CorrectSyntaxAsync(text, locale);
     
     return Ok(new
     {
         Success = true,
         v = correctedContent
     });
 }
 // you need to implement it yourself
 private async Task<string> CorrectSyntaxAsync(string text, string locale)
 {   string result = null;
     // your logic to perform syntax checking
     return result;
 }

You can find more on our GitHub demo page: https://github.com/aspose-cells/Aspose.Cells.Grid-for-.NET/blob/master/Examples_GridJs/wwwroot/xspread/index.html