Manual Array Guid Support
If I have a custom control that has a Guid[] field, how can I set that property in a custom designer? I'm trying to create a clientside array or a JSON string, but neither seem to work
(I suppose I could store as a JSON string and parse that out in the code back to Guid[], but I was hoping there was a built-in direct method?
var selectedForms = []; var formBox = $find("formsListBox"); var items = formBox.get_items(); for (var i = 0; i < items.get_count(); i++) if(formBox.getItem(i).get_selected()) var item = formBox.getItem(i); //Add to array selectedForms.push(item.get_value()); controlData.FormIDs = selectedForms; //Nope // controlData.FormIDs = JSON.stringify(selectedForms); //NopeHello Steve,
That's a tough one, you can try using Rado's approach from this blog post, which deals with a similar scenario and uses KnockoutJS.
Regards,
Boyan Barnev
the Telerik team
I've already done that (one better, Kendo MVVM http://www.screencast.com/t/8qgVeaFOzjq :)
So is what you're saying that if I have a property defined like this
public Guid[] GuidItemsget;set;var selectedForms = ["<guid>","<guid>"];controlData.SelectedForms = selectedForms;Hello Steve,
The field type is Guid[]. Here's a recent example on how we're setting it server side:
personalInformationItem.SetValue("ProfessionalExperience", new Guid[] Guid.NewGuid(), Guid.NewGuid() ); What about client though? Should it be set back with an object array like I posted?
Like controlData.SelectedForms = selectedForms; should auto-save back from the designer to the backing field right?