We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

deleteRecord issues

had some issues with deleteRecord so I tried to create a simple sample

added the following code to one of your samples

function mydelete() {
   _ejGrid = $("#DestGrid").data("ejGrid");
   
   var selrecs = _ejGrid.getSelectedRecords()
   var rowtodel = selrecs[0];
   
    _ejGrid.deleteRecord("OrderID", rowtodel );
        }

the row never gets deleted. No error either



1 Reply

PK Prasanna Kumar Viswanathan Syncfusion Team February 6, 2017 10:12 AM UTC

Hi Michael, 

Thanks for contacting Syncfusion support. 

We checked in our sample with the following code and we can able to delete the record in the grid.  

Find the code example and sample:  

 
<button id="button" onclick="mydelete()">Delete</button> 
    <div id="Grid"></div> 
 
    <script type="text/javascript"> 
         $(function () { 
             $("#Grid").ejGrid({ 
                 dataSource: window.gridData, 
                 allowSorting:true, 
                 allowPaging: true, 
                 --------------------------- 
                columns: [ 
                       ---------------------------- 
                 ]  
             });           
         }); 
 
         function mydelete(args) { 
             _ejGrid = $("#Grid").data("ejGrid"); 
             var selrecs = _ejGrid.getSelectedRecords() 
             var rowtodel = selrecs[0]; 
             _ejGrid.deleteRecord("OrderID", rowtodel); 
         } 



To find out the root cause of the issue, we need the following details, 

1. Ensure that you have select the particular record in grid before performing the delete operation. 

2. Code example of a Grid. 

3. Ensure that you face any script error in the console? If yes, Share the screenshot of an console error.  

4. Ensure that you have enable isPrimaryKey property for the unique column and allowDeleting property in editSettings API.  

5. Essential Studio Version details.   

Regards, 
Prasanna Kumar N.S.V 
 


Loader.
Live Chat Icon For mobile
Up arrow icon