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

[Solved] Remove All Data from Editable Field with Custom Button

1 Answer 63 Views
Grid
This is a migrated thread and some comments may be shown as answers.
jeff
Top achievements
Rank 1
jeff asked on 25 Feb 2015, 09:47 PM
Hi! I've made a custom button to replace the 'Delete' ('destroy') button in an inline editing grid - How do I delete the data with this button in a specific field?:

01.{ command: [
02.   { name: "edit" },
03.   {
04.       name: "Remove Notes",
05.       click: function(e) {
06.    var tr = $(e.target).closest("tr");
07.    var data = this.dataItem(tr);
08. 
09.    var DelNotes = confirm('You wish to delete this stuff?');
10.    if (DelNotes == true) {
11.        confirm = data.FILE_DESC = 'Some Data Here...';
12.        //How do I delete the contents of the field data.FILE_DESC?
13.    } else {
14.        //No deletions here!
15.    }
16. 
17.       }
18.   }
19. ], title: " ", width: "175px" }],


Thank you!

1 Answer, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 27 Feb 2015, 11:37 AM
Hi Jeff,

You may use the set method of the model (dataItem).
var data = this.dataItem(tr);
data.set("FILE_DESC", "");

If you want to synchronize the changes with the server (in case you use remote transport) you should also call the saveChanges method.

Regards,
Alexander Valchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
jeff
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Share this question
or