Telerik Forums
Kendo UI for jQuery Forum
1 answer
122 views
I've actually extended the ComboBox and added some of my own fuunctionality tpo it. It's workign very well so far, but for one little slight annoyance.

I want to prevent the ComboBox from automatically making a selection when the text in the editable area matches exactly the stated value of the item. This has to do with CSS reasons mostly. Also, I've overwritten the arrow scrolling, so that when you press the down arrow it will focus the next element (adds k-state-focused), but it does not actually select the value until you either hit enter, or click on it. I've tried removing the "k-state-selected" class from the element, but that causes errors when I actually go to select an item with the mouse, in that it causes the "e.item" to not be defined and so I'm unable to perform any "select" actions based on the selected value.

Any suggestions?

Kiril Nikolov
Telerik team
 answered on 11 Feb 2014
2 answers
196 views
Hi ... relatively new to webdev ...

I'm trying to populate the treeview from an async remote data source

var tree = $('#treeview').kendoTreeView({   
        dataSource: getQueryData(),
        dataTextField: "Name",
        select: function (e) { 
         var id = this.dataItem(e.node).id;
         onChange(id);
        }

I need to retrieve the data then process it prior to setting the data source in order to add sprites. Thus far my solution is as follows

  function fetchData(cb) {
    var data = [];
    var ds = new kendo.data.DataSource({
      transport: {
        read: {
          url         : "http://localhost:57773/api/definitions",
          dataType    : "json"
        }
      }
    });

    ds.fetch(function () {
      data = cb(ds.data());              
    });      

    return data;
  };

  function addSprites (data) {
    for (var key in data) {
      if (key == "NodeType") {
       data.spriteCssClass = data.NodeType;
      }

      if (data[key] !== null && typeof(data[key])=="object") {
        addSprites(data[key]);
      }
    }
    return data
  };

  function getQueryData () {  

    var dataitems = fetchData(addSprites);
    
    var hds = new kendo.data.HierarchicalDataSource({
      data: dataitems,
      schema: {
        model: {
          id          : "Key",
          hasChildren : "HasChildren"          
        }
      }  
    });

    return hds;
  }; 

I am not quite sure how I should be architecting this since the hierarchical data set is returning prior to the completion of the async data retrieval and pre-processing of that data. I'd be grateful if someone could give me a steer as to how to do this "properly". If possible I'd like to avoid going synchronous.

Thx IA.

Simon
Alex Gyoshev
Telerik team
 answered on 11 Feb 2014
1 answer
176 views
Hi, is there any configuration to prevent Editor from converting Greek characters to html entities? For example, by default Editor converts "ΑΒΓ" to "ΑΒΓ". Any workarounds? BTW, I use the MVC wrapper.
Alex Gyoshev
Telerik team
 answered on 11 Feb 2014
7 answers
140 views
Hi,

I want to create an application that will work on browsers, tablets and smartphones. How do I start? is there anything special that I have to take into consideration from the beginning? I'm asking because I already created a browser application  infrastructure using the templateLoader example that I found in one of your tutorials, and I'm also working with your router and I'm not sure that I'm in the right direction...It looks good on browser but that are the things that I have to think about if I want my app to work on other devices as well?
Sebastian
Telerik team
 answered on 11 Feb 2014
7 answers
831 views
I've been beating this dead horse for the last 2 weeks, on and off and still can't figure it out.

This is my datasource js:

var myDS = new kendo.data.DataSource({
    transport: {
        read: {
            url: 'dataset.json'
            ,dataType: "jsonp"
            ,data: { select: "ID,NAME" }
        }
    },
    schema: {
        data: function(response) {
            return response.features;
        },
        model: {
            fields: {
                "properties.ID": { type: "number" },
                "properties.NAME": { type: "string" }
            },
        }
    }
});

This is my dropdownlist init:

$("#dropdown").kendoComboBox({
    placeholder: "...",
    autoBind: false,
    suggest: true,
    dataTextField: "properties.NAME",
    dataValueField: "properties.ID",
    dataSource: myDS
});

This is my datasource table:

ID  |  NAME
-------------
1   |   0,4
2   |   6
3   |   10
4   |   20
5   |   35
6   |   110
7   |   220
8   |   400

The error 'Object doesn't support property or method 'toLowerCase'' pops up when trying to init the ddl - because my textfield values are basically numbers (but set as string in model and database!!), which are treated as strings - if I check the return values of datasource in Firefox and Chrome i see that my return values are treated as strings. The same goes for IE10 and above, but IE9 and IE8 treat those values as numbers, even if I've set the name field as string in datasource.

I've tried everything, I even went through all of the return rows of dataset and converted all of the name values to string, but that didn't help either. Not only that - if i try to print the response.features to console i get undefined in ie8/ie9 (what?).

Can anyone help me?
Atanas Korchev
Telerik team
 answered on 11 Feb 2014
2 answers
142 views
Hi, im evaluating the Kendo Mobile UI with application framework to develop a hybrid app for Android and IOS.

Im using application Framework, separating classes using .js files.

The problem is that visual studio 2013 intellisense doesnt provide any help for class constructor (for example when i wrote new User() intellisense dont suggest the constructor parameters defined).

any idea?

/*
User = kendo.data.ObservableObject.extend({
    init: function(username,nombre,apellido,email){
        this.username = username;
    }
});
*/

EXAMPLE FILES:

app.js

var app = new kendo.mobile.Application($(document.body), {
    user : null,
    loginService: null,
    skin:'flat',
    transition: 'slide',
    initial :  "views/account/login.html",
    init: function () {
        this.loginService = new LoginService();
        if (this.loginService.loadLocalCredential())
            this.initial = 'views/home/index.html';
    }
});

login.js

LoginService = kendo.data.ObservableObject.extend({
    username: "",
    password: "",
    isLoggedIn: false,
    login: function () {
        var that = this;
        var url = 'http://url/Account/Login?username=' + this.username + '&password=' + this.password;
        $.ajax({
            url: url,
            dataType: "json",
            success: function (data, textStatus, jqXHR) {
                if (data.result == true) {
                          var user = new User(username,nombre,apellido,email); /* when i write new User() intellisense doesnt provide any help*/
                    that.set("isLoggedIn", true);
                    app.navigate("./views/home/index.html");
                }
            }
        });
    },
    logout: function () {
        this.clear();
        app.navigate('./views/home/index.html');
    },
    clear: function () {
        this.set('username', '');
        this.set('password', '');
        this.set('isLoggedIn', false);
    },
    loadLocalCredential: function () {
        this.set('username', 'geoorge');
        this.set('password', '1231');
        this.set('isLoggedIn', true);
         
    }
 
});


user.js

User = kendo.data.ObservableObject.extend({
    username: "",
    nombre: "",
    apellido: "",
    email: "",
    isLoggedIn: false,
    init: function(username,nombre,apellido,email){
        this.username = username; this.nombre = nombre; this.apellido = apellido; this.email = email;
    }
});


Thanks!
Kiril Nikolov
Telerik team
 answered on 11 Feb 2014
1 answer
90 views
Is there a way to block out the slots for an all day event, instead of having the event in the "all day" slot?
Rosen
Telerik team
 answered on 11 Feb 2014
3 answers
543 views
I need to be able to set a fixed width for the labels of the Value Axis.  I have a problem caused by the re-scaling of the plotting area based on the number of digits in the valueAxis labels.  I need some way to keep the actual chart area (compared to the value axis) to stay the same width, so that I can consistently line up with other elements on my page.
 
  I can't seem to find any documentation and 

valueAxis: { 
labels:{ 
width: 100
}, 
width: 100, 
}, 

does not work.  Is this possible?  PlotArea and ChartArea width also seems to have no effect. 

-Thorne

Iliana Dyankova
Telerik team
 answered on 11 Feb 2014
5 answers
219 views
Hello,
I'm using MVVM approach in DropDownList configure. Everything works fine but I unexpectedly stuck on the "data-option-label" attribute value == "[ None ]". This value causes error "SyntaxError: Unexpected token N ". Using '[ .. ]' instead of '( .. )' is very important for our designer, so.. please take a look at jsFiddle example. Thank you.
Kiril Nikolov
Telerik team
 answered on 11 Feb 2014
2 answers
108 views
I have a batch editing grid where the user can add a new row either by clicking the Add button or tabbing off of the last editable column. The Add button works as intended...it adds a new row at the bottom of the grid and puts the keyboard focus in the first column of the new row.

The problem I am having is calling addRow programatically. It creates the new row at the bottom of the grid, but it automatically puts the keyboard focus in the second column of the new row. I want it to behave the same way as pressing the Add button. Here is the script that catches my keypress [TAB], and determines if it is the last row and last column (in my case it's column index 6). 

function onDataBound(e) {
               var grid = $("#VINGrid").data("kendoGrid");
 
               $(grid.tbody).on("keydown", "td", function (e) {
                 
 
                 if (e.keyCode == 9)
                 {
                       var row = $(this).closest("tr");
                       var rowIdx = $("tr", grid.tbody).index(row);
                       var colIdx = $("td", row).index(this);
 
                       var count = grid.dataSource.total();
 
                       if(rowIdx == count-1 && colIdx == 6)
                       {
                           grid.addRow();
                       }
                   }
               });
           }

Any idea why my script is automatically moving it to the second column? 

Thanks,
Jason
Dimiter Madjarov
Telerik team
 answered on 11 Feb 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?