Connecting the Editor with a Windows service

Connecting the Editor with a Windows service

camgracamgra Posts: 3Questions: 2Answers: 0

We are looking to utilize the editor in an MVC-like application, however, our data is not driven from an SQL database directly, but rather a Windows service. We have successfully utilized this process for DataTables, but not with the editor. Part of the problem is that I do not understand how the editor "speaks" to the controllers... Normally, we utilize code like this:

        [Route("api/UserStatusData/{username}/{type}")]
       [HttpGet]
       public IHttpActionResult Get(string username, int type)
        {
            using (svcFA.FinanceAuditServiceClient svc = new svcFA.FinanceAuditServiceClient())
            {
                try
                {
                    var list = svc.GetUserStatusList(username, type);
                    return Ok(list);
                }
                catch (Exception ex)
                {
                    return InternalServerError(ex);
                }
            }
        }

This represents the GET verb, but with the POST and PUT verbs, we would simply send an object. With DELETE, we would send an ID and username.
So, my questions:
1. Can we utilize a windows service with "editor" rather then a direct SQL connection?
2. Can we utilize the .net dll, or should we use JS directly?
3. How does the editor interact with the control if there is no specification of verbs when using the ajax function?

Ideally, we would like to utilize the inline functions of the editor with a dropdown option on one column only.

As I have not yet configured the datatable, I don't have any logs to show at this point as this is mostly theoretical, but I can provide additional code samples of the .NET application if needed.

Thanks,
Graham C

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin
    Answer ✓

    Hi Graham,

    Thanks for your questions.

    1. Can we utilize a windows service with "editor" rather then a direct SQL connection?
    2. Can we utilize the .net dll, or should we use JS directly?

    Yes, you can still use Editor, but you wouldn't use the provided dll. It is specifically designed to interface with an SQL server. That is more or less its sole reason for existing!

    The way Editor communicates with the server is documented here. Moreover, you can use the ajax option to specify the HTTP verbs that Editor uses to make the Ajax request to the server. There is a simple example here.

    1. How does the editor interact with the control if there is no specification of verbs when using the ajax function?

    By default Editor will use POST requests.

    Regards,
    Allan

This discussion has been closed.