Setting the DataSourceSchema attribute of the datasource in a kendo combobox in Razor syntax

2 posts, 1 answers
  1. VasVas
    VasVas avatar
    31 posts
    Member since:
    Nov 2012

    Posted 19 May 2013 Link to this post

    I am tring to synco a streets combo which is cascaded with a citys combo with it's value in the model.
    I am tring to use the fallowing js lines:

    var combobox = $("#MyStreetsCombo").data("kendoComboBox);
    var dataItem = combox.dataSource.get(combobox.value());;

    var dataItem is always undefined.

    I have seen this post
    but I do not understand how to pass the jsonobject DataSourceSchema to set the id of the model in the rasor syntax.

    .DataSource(source => {
                                         source.Read(read =>
                                               readAction("Action" , "Controller")
                                             .DataSourceSchema( new  {model  ..... id = 'Value'}).???;


  2. Answer
    Georgi Krustev
    Georgi Krustev avatar
    3688 posts

    Posted 22 May 2013 Link to this post

    Hello Ariel,

    The DataSource builder used by ComboBox allows to define only the read url. Currently, setting the DataSource scheme is not supported. If you need to get the selected data item then you can use the ComboBox's dataItem method. If still need to use get method of DataSource, then loop array returned by the data method and find the correct data item.

    Georgi Krustev
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. UI for ASP.NET AJAX banner
Back to Top