1

I am trying to edit a cell's innerText property. The text is shown in the table but the problem is that the row isn't being marked as updated, so when I press my "Save Changes" button the update method doesn't get this row (in the list of rows to update).

I am trying to use this method (updateRow) but so far it has been unsuccessful:

var grid = ("#grid").data("tGrid");
var rowToUpdate = grid.data[0];
rowToUpdate.quantity = 4;
grid.updateRow(rowToUpdate);

When the method is called I get the following exception:

"object does not support this property or method".

in the source of telerik. Does anyone know how to mark a row as updated? Or a better way to update the value of cell in row?

3
  • As I mentioned in my answer, updateRow expects you to supply the actual row element (wrapped by jQuery), and not the object acting as the data. Commented Jun 19, 2012 at 11:31
  • I saw example using rowUpdate method with an object in telerik site: link Commented Jun 20, 2012 at 6:00
  • ah, i hadn't noticed that before. Commented Jun 20, 2012 at 6:04

1 Answer 1

3

You can use the client-side method updateRow to force updating. The key is selecting the table row you wish to update, as indicated in their example (of course, you don't have to use their $('#Grid .t-grid-edit-row') selector; you can use any selector, so long as it selects the row you wish to update). I believe that your modifying of the cell's innerHTML/innerText to communicate the new value is how its done.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.