Use editor with table form controls - onclick open my own edit view (.net Core

Use editor with table form controls - onclick open my own edit view (.net Core

Pedro MartinsPedro Martins Posts: 22Questions: 11Answers: 0

Hello i have been struggling,

This question has an accepted answers - jump to answer

Answers

  • Pedro MartinsPedro Martins Posts: 22Questions: 11Answers: 0
    edited October 2019

    Hello i have been struggling with this... i want to use editor for the easy serverside configuration and join tables, but i need to use my own views for Editing and details.
    I have been trying to config editor with table form controls but can´t manage to pass on the id's for my stored rows.

    I need to construct the following url "/Person/Edit/5"

  • allanallan Posts: 61,722Questions: 1Answers: 10,108 Site admin
    Answer ✓

    I need to construct the following url "/Person/Edit/5"

    See this example for details on how to do that.

    Allan

  • Pedro MartinsPedro Martins Posts: 22Questions: 11Answers: 0

    Hello again @allan Thanks for your response!

    I managed to make it work like this

            {
                "data": "id",
                "render": function (data) {
    
                    var btnEdit = "<a class='btn btn-default btn-xs' onclick=location.href='/" + "Person/Edit/" + data + "'><i class='fa fa-pencil'></i>Edit</a>";
                    var btnDetails = "<a class='btn btn-default btn-xs' onclick=location.href='/" + "Person/Details/" + data + "'><i class='fa fa-pencil'></i>Details</a>";
    
                    return btnEdit + " / " + btnDetails;
                }
            }
    

    But will try it with you example having just one edit or details button is cleaner...

This discussion has been closed.