GridView cell to cell drag and drop to save data to store/database

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    GridView cell to cell drag and drop to save data to store/database

    I'm using a .CellDragDrop() in a .GridView() to move data from one cell to another. This works, however I am trying to have the data that I dragged replace what was previously in the database. I am having trouble using a direct event to trigger this. Here is my code:

    Html.X().GridPanel()
        .Store(
            Html.X().Store()
                .ID("storeReqPriorities")
                .AutoLoad(true)
                .DataSource(clients)
                .Model(
                    Html.X().Model()
                        .Fields(f =>
                        {
                            f.Add(Html.X().ModelField().Name("RequestPriorityKey").Type(ModelFieldType.Int));
                            f.Add(Html.X().ModelField().Name("RequestPriorityName").Type(ModelFieldType.String));
                            f.Add(Html.X().ModelField().Name("RequestPriorityDescription").Type(ModelFieldType.String));
                            f.Add(Html.X().ModelField().Name("SortOrder").Type(ModelFieldType.Int));
                            f.Add(Html.X().ModelField().Name("ResponseTarget").Type(ModelFieldType.String));
                            f.Add(Html.X().ModelField().Name("ResponseFormat").Type(ModelFieldType.String));
                            f.Add(Html.X().ModelField().Name("ResponseSLA").Type(ModelFieldType.String));
                        })
                )
                .ServerProxy(
                    Html.X().AjaxProxy()
                        .Url(Url.Action("ManageLists_GetRequestPriorities", "Admin", new { area = "Cadence" }))
                )
        )
        .Listeners(l =>
        {
            l.Select.Handler = "handleReqPopulate(record.data);" + "toggleEditRequest();";
        })
        .ColumnModel(
            Html.X().Column().Flex(1).Text("Request Priority Name").DataIndex("RequestPriorityName"),
            Html.X().Column().Flex(3).Text("Request Priority Desciption").DataIndex("RequestPriorityDescription"),
            Html.X().Column().Flex(1).Text("Sort Order").DataIndex("SortOrder"),
            Html.X().Column().Flex(1).Text("Response Target").DataIndex("ResponseTarget"),
            Html.X().Column().Flex(1).Text("Response Format").DataIndex("ResponseFormat"),
            Html.X().Column().Flex(1).Text("Response SLA").DataIndex("ResponseSLA")
        )
        .View(
            Html.X().GridView()
                .Plugins(
                    Html.X().CellDragDrop().ApplyEmptyText(true).EnforceType(true)
                )
                .DirectEvents(d =>
                {
    
                })
        )
    Please let me know if there is a way to save the data that I have dragged to the database.
    Last edited by fabricio.murta; Nov 19, 2019 at 1:28 AM. Reason: improves formatting of pasted code snippet.

Similar Threads

  1. Replies: 5
    Last Post: Sep 24, 2015, 12:28 PM
  2. [CLOSED] Drag Cell from Grid 1 and Drop to Grid 2 Cell
    By redi in forum 2.x Legacy Premium Help
    Replies: 9
    Last Post: Nov 18, 2013, 7:20 AM
  3. Drag Cell from Grid 1 and Drop to Grid 2 Cell
    By darkwalker in forum 2.x Help
    Replies: 0
    Last Post: Sep 24, 2013, 4:53 AM
  4. Replies: 0
    Last Post: Jun 28, 2013, 5:53 AM
  5. Replies: 8
    Last Post: Jun 06, 2013, 1:58 PM

Tags for this Thread

Posting Permissions