Manipulating dataSource with nested templates

4 posts, 1 answers
  1. Savas
    Savas avatar
    16 posts
    Member since:
    Nov 2015

    Posted 16 Nov 2015 Link to this post

    Hi, I've recently started working with Kendo UI. I have been reading this forum to find answers usually very good. However I am struggling to replicate inline json data in to remote one. Please see below. This works fine creating me the Title for the radio group just as expected however the minute I try using the remote JSON.

    http://jsbin.com/sanixi/edit?html,js,output

    This is the code should be replacing " var tileDataSource " array with it's remote counterpart below:

     var tileBaseUrl = "//localhost:8000/data/repTiles.json";
        var tileDataSource = new kendo.data.DataSource({
            transport: {
                  read: {
                      url: tileBaseUrl,
                      contentType: "application/json; charset=utf-8",
                      dataType: "json"
                  },
                  update: {
                      url: tileBaseUrl,
                      dataType: "json"
                  },
                   create: {
                      url: tileBaseUrl,
                      dataType: "json"
                  },
                  destroy: {
                      url: tileBaseUrl,
                      dataType: "json"
                  },
                  parameterMap: function(obj, operation) {
                      if (operation !== "read" && obj.models) {
                          return {
                              models: kendo.stringify(obj.models)
                          }
                      }
                      return obj;
                  }
              }
       });

    What am I missing here? what am I doing wrong? trying to achieve an all remote JSON code here. I have used this code for to remote load JSON for kendoComboBox and kendoDropDownList etc. All worked fine.

    Please have a look any ideas how I can achieve this.

    Thanks.

     

  2. Savas
    Savas avatar
    16 posts
    Member since:
    Nov 2015
  3. Kendo UI is VS 2017 Ready
  4. Answer
    Daniel
    Admin
    Daniel avatar
    2117 posts

    Posted 18 Nov 2015 Link to this post

    Hello,

    I am not sure if I understand correctly what you mean by replace, but if "tileDataSource" is a dataSource then the Categories dataSource should no longer be needed(updated example). Also, the latest versions support source binding to dataSource so the change handler should also not be needed.

    Regards,
    Daniel
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  5. Savas
    Savas avatar
    16 posts
    Member since:
    Nov 2015

    Posted 19 Nov 2015 in reply to Daniel Link to this post

    Thanks Daniel. I am creating nested templates and loading different input types, I managed radio group and check box types so far, no sure yet this type of template support combobox and rage sliders.

    In my trial and error  approch I could not get it to load the JSON remotely. I guess " tileDataSource.read() " was missing.

    That works perfect now.

Back to Top
Kendo UI is VS 2017 Ready