This is a migrated thread and some comments may be shown as answers.

Javascript Classes Intellisense

2 Answers 89 Views
Application
This is a migrated thread and some comments may be shown as answers.
Jorge
Top achievements
Rank 1
Jorge asked on 08 Feb 2014, 06:41 AM
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 Answers, 1 is accepted

Sort by
0
Jorge
Top achievements
Rank 1
answered on 08 Feb 2014, 06:59 AM
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) {
     
}
0
Kiril Nikolov
Telerik team
answered on 11 Feb 2014, 11:25 AM
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!
Tags
Application
Asked by
Jorge
Top achievements
Rank 1
Answers by
Jorge
Top achievements
Rank 1
Kiril Nikolov
Telerik team
Share this question
or