This is a migrated thread and some comments may be shown as answers.

Patch to allow GridBatchEditing.deleteRecord to delete rows that fails validation

1 Answer 54 Views
Grid
This is a migrated thread and some comments may be shown as answers.
أشرف
Top achievements
Rank 1
أشرف asked on 19 Dec 2013, 11:35 AM
As I mentioned before, the GridBatchEditing.deleteRecord triggers the row validators if the row to be deleted is open.
I didn't find a way around it but to override the default deleteRecord and disable the global validation. Here's the code:
var origDeleteRecord = batchManager.deleteRecord;
 
    batchManager.deleteRecord = function (tableView, row)
    {
        var pv = window.Page_Validators;
 
        window.Page_Validators = null; // HACK:
 
        batchManager.raise_rowDeleting(row);
 
        origDeleteRecord.call(batchManager, tableView, row);
 
        batchManager.raise_rowDeleted(row);
 
        window.Page_Validators = pv;
    }

Where batchManager is a variable obtained from calling get_batchEditingManager, and the rowDeleteing/Deleted are manual events I add to the object to cater for other components.

1 Answer, 1 is accepted

Sort by
0
Accepted
Konstantin Dikov
Telerik team
answered on 24 Dec 2013, 08:46 AM
Hi Ashraf,

Thank you for sharing your workaround with the community.

As the Batch edit mode is rather new functionality and it is constantly improved by our developers team, bringing issues or suggestions to our attention is really appreciated. 


Regards,
Konstantin Dikov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Grid
Asked by
أشرف
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or