Javascript Classes Intellisense

3 posts, 0 answers
  1. Jorge
    Jorge avatar
    2 posts
    Member since:
    Apr 2012

    Posted 08 Feb 2014 Link to this post

    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!
  2. Jorge
    Jorge avatar
    2 posts
    Member since:
    Apr 2012

    Posted 08 Feb 2014 in reply to Jorge Link to this post

    Update:

    added _references.js and still not working.

    /// <reference path="user.js" />
    /// <reference path="login.js" />
    /// <reference path="app.js" />


    using traditional javascript class definition works ok.. any idea to do the same using kendo?

    Usuario = function (nombre,apellido) {
         
    }
  3. Kendo UI is VS 2017 Ready
  4. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2565 posts

    Posted 11 Feb 2014 Link to this post

    Hi Jorge,

    Please check the following help article for more details of the VS intellisense support. Unfortunately, Visual Studio is not aware of the extend based inheritance implementation. 

    Regards,
    Kiril Nikolov
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top