10 Answers, 1 is accepted
EDIT: Found a temporary solution -->
$('#spreadsheet .k-spreadsheet-cell-editor').bind('focusout', function () {
var toolTip = $('.k-tooltip');
var cell = $(toolTip).eq(1).text();
var value = $(this).text();
alert(cell + " -> " + value);
});
Hello Avnish,
At this time there is no change event in the widget, but it has been logged for consideration for future releases. You can vote on UserVoice to raise its priority.
Regards,Alex Gyoshev
Telerik
Hi Alex,
I could really use this spreadsheet widget. Currently I use the silverlight spreadsheet control but have to move to a HTML 5 version very soon. Have you any idea if a cell value changed event might be included in the next release?
Thanks,
John
Hello John,
We have not implemented this yet, but it is likely that it will land soon. There have been many requests for that specific event.
Regards,Alex Gyoshev
Telerik
Hi Alex,
seems that the onchange event has been released in the in Q1 2016.
However, i was expecting to get the object ( in this case the cell ) that fired the onchange event.
Instead, seems that the sender is the worksheet itself.
So, Is there another way to achieve this? That is, get the cell whose values has changed?
Regards,
Hello John,
See the change event documentation, the range property of the event argument should provide that. The event is introduced in 2016.Q1.SP1, version 2016.1.226.
Regards,Alex Gyoshev
Telerik
Hello Alex,
unfortunately the Range object is not able to return the position of the cell (i.e.: "C2" or "B5").
It is possible to get the value(), but, as far as i can see, not the R1C1 position of the cell.
Regards,
Hello John,
Currently such data is not exposed in the public API. You could access it via a private API -- e.range._ref.print(), but that is not recommended and may break without notice. Can you please elaborate what is the use case behind this?
Regards,Alex Gyoshev
Telerik
Hi Alex,
thanks for your clarification.
I am actually trying to extend the 'cell object', in order to contain not only a Value and layout attributes. I would attach custom objects , with own properties.
And what i m trying to do is to individuate exactly which cell of the sheet has fired the onChange event. Also a Row-Col index would work. In order, then to get the 'cell object' and loop through its properties.
Is it something i can achieve at this stage?
Thanks
Hello John,
There is an undocumented forEachCell method on the range, which was just documented. It accepts a callback, which will be called for each cell, and will receive the row index, column index, and cell options. Then you can maintain a hash with the row/column indices.
Regards,Alex Gyoshev
Telerik