Highlight Row

Highlight Row

ArashArash Posts: 4Questions: 1Answers: 0
edited January 2021 in Free community support

I'm use modal for edit row custom,now i want after submit and then hide modal, background row updated is highlight for a moment,
i get data with ajax from server.

var table = $('#mytable').DataTable({
                "ajax": {
                    "url": "Controller/Getlist",
                    'datatype': 'json',
                    'type': 'GET',
                    'serverSide': true,
                    "data": function (success) {
                    }
                },
                'columnDefs': [
                    {
                        orderable: false,
                        className: "customselect",
                        targets: 0
                    }
                ],
                order: [[1, 'asc']],
                'columns': [
                    {
                        'data': null,
                        defaultContent: '<a class="customselect fa fa-square-o" /a>',
                        width: '15px',
                        searchable: false
                    },
                    { 'data': 'User.NationalCode', width: '15px' },
                    { 'data': 'User.FullName', width: '40%' },
                    { 'data': 'GetPersianNamesRollType', width: '100px' },
                    {
                        'data': "Id", 'render': function (data, type, row) {
                            return "<button class=" + '"btn btn-sm btn-label icon fa fa-pencil"' + "type=" + '"button"' + "data-target=" + '"#mymodaledit"' + "title=" + '"edit"' + " data-toggle=" + '"ajax-modal"' + "data-url=" + "'/Controller/Edit/" + data + "'" + "></button>"
                        }, 'bSortable': false
                    },
                ],
                rowId: "Id"
});

Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    I'm not too clear what you're trying to achieve, as by default any edited row is highlighted for a few seconds when the form closes. This may help though - http://live.datatables.net/zajekoha/4/edit - here the row flashes then stays highlighted. It's using postEdit,

    Colin

  • ArashArash Posts: 4Questions: 1Answers: 0

    thank a lot
    I'm not use of Edited DataTables tools.
    i want when submit or save data with my modal, then hidel modal and just row current a few second highlight. (my project is MVC Visual Studio.net

  • ArashArash Posts: 4Questions: 1Answers: 0

    How Can Use of PostEdited event (alone) without use Edit ?

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Ah, sorry, I thought you were using Editor. Without it, you would need to implement that in your own code.

    Colin

  • ArashArash Posts: 4Questions: 1Answers: 0

    I'm Trying...
    its done.

This discussion has been closed.