gijgo icon indicating copy to clipboard operation
gijgo copied to clipboard

cellDataChanged event is not working

Open lalithkumarLAM opened this issue 5 years ago • 1 comments

cellDataChanged event is not triggering when clicking on outside the Gridor any other controls. It triggers only when we do mouse click on another editable cell. Can we have any option to overcome this issue. WE have a client delivery in few days.

Treat this as a critical issue.

Thanks, Lalith

lalithkumarLAM avatar Aug 10 '20 13:08 lalithkumarLAM

grid.on('rowDataChanged', function (e, id, record) { // Clone the record in new object where you can format the data to format that is supported by the backend. var data = $.extend(true, {}, record); // Format the date to format that is supported by the backend. data.DateOfBirth = gj.core.parseDate(record.DateOfBirth, 'mm/dd/yyyy').toISOString(); // Post the data to the server $.ajax({ url: '/Players/Save', data: { record: data }, method: 'POST' }) .fail(function () { alert('Failed to save.'); }); }); you can rewrite

var data =null;
 grid.on('rowDataChanged', function (e, id, record) {
                // Clone the record in new object where you can format the data to format that is supported by the backend.
                data = $.extend(true, {}, record);
            });
$('#yourButton').on('click',function(){
                $.ajax({ url: '/Players/Save', data: { record: data }, method: 'POST' })
.done(function(){
alert('saved');
})
                    .fail(function () {
                        alert('Failed to save.');
                    });
});

soncapham avatar Sep 08 '20 03:09 soncapham