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

Updating: hidden attributes?

0 Answers 118 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tom
Top achievements
Rank 1
Tom asked on 01 Feb 2012, 12:52 PM
Hi there,

I'm having a problem setting an edited row to be called for updating back to the server. The default edit along with save using the toolbar works perfectly. However, i wish to make use of a form.  Somewhere somehow I have to either set an attribute or throw the item into a queue so that Kendo knows it needs to perform an update query.

<code>
    $("#form-edit").live("submit",function(e) {
    // Declaring grid
    var grid = $("#grid").data("kendoGrid");
   
    // Getting values of selected item
    var row = grid.dataItem(grid.select(grid.tbody.find()))
   
    // Declaring window
    var window = $("#window-edit").data("kendoWindow");
   
    // Setting variables for editable row       
    row.Name = $("#form-edit-name").val();
    row.GeoLocation = $("#form-edit-location").val();
    row.Active = $("#form-edit-activity").val();
    row.ContactNo = $("#form-edit-number").val();      

// Grid refreshing and database sync
// grid.refresh();
grid.saveChanges();

// Closing form window
window.close();
    });
</code>

The default kendo way (using inline as well as the toolbar save) works 100% thus proving that my datasource has been successfully set up.  

Regards,

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Tom
Top achievements
Rank 1
Share this question
or