Hi all,
I've created a spreadsheet app that uses a dropdown list in a similar fashion to this: http://dojo.telerik.com/@nenchef/ojEWU/3
I would like to update the data in the spreadsheet when I make a selection in the dropdown. The problem I'm having is that I can't seem to trigger a
read or the model's accessor methods. The best I've been able to do is trigger a change on the spreadsheet like this:
model.bind("change", function (e)
{
var spreadsheet = $("#spreadsheet").data("kendoSpreadsheet");
spreadsheet.trigger("change");
});
Any help appreciated.
Best
6 Answers, 1 is accepted
Hi c0dr.64d1,
Here is a Dojo example that shows how we can use the change event of the DropDownList to change a value in the Spreadsheet. The changes I made in the project you've sent me are in the "el" definition as follows:
$("<div data-visible='true' data-role='window' data-modal='true' data-resizable='false' data-title='Select item '>" +
" <div data-role='dropdownlist' data-bind='value: value, source: products, events: {change: onChange }' data-text-field='ProductName'></div>" +
" <div style='margin-top: 1em; text-align: right'>" +
" <button style='width: 5em' class='k-button' data-bind='click: ok'>OK</button>" +
" <button style='width: 5em' class='k-button' data-bind='click: cancel'>Cancel</button>" +
" </div>" +
"</div>");
Then in the model, we have the following function:
onChange: function () {
var spreadsheet = $("#spreadsheet").data("kendoSpreadsheet");
var activeSheet = spreadsheet.activeSheet();
activeSheet.range("C5").value("111111111");
}
I hope the above demonstrates what you want to implement in your application.
Regards,
Petar
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
Hi c0dr.64d1,
In general, all events triggered by our components have a "sender" property in their event handler. Maybe you don't expect this answer but this is what I can share, based on the available information.
To help you with the issue, I will need a runnable example that implements your custom logic of the DataSource change event. Can you use the Dojo example I've sent you as a basis and add your custom logic to it? Having the whole context, I can think about a possible solution for your issue.
Last but not least, I can see that you have a Priority support license. Our usual response time for the forum threads is 72 hours. If you submit a support ticket(your plan allows it), the response time will be 24 hours and thus we can speed the communication up.
Another benefit of the Support ticket is that your implementation is not publicly shared if you have concerns about this. If you decide to submit a support ticket, please share the requested runnable example in it. You can also add other details that you think will be useful for resolving the issue.
Regards,
Petar
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
Hi c0dr.64d1,
Based on the communication in support ticket #1506694, I will close this thread.
Regards,
Petar
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.