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

n.get is not a function

9 Answers 1519 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Tony
Top achievements
Rank 1
Tony asked on 30 Apr 2015, 07:12 PM
I am utilizing the comboBox as part of my mvvm application. The comboBox is getting the data bind value from a complex object that is set as a property within the vm. Everything appears to show up visually. However, I noticed whenever I switch the selected option in my UI, I get an error of "Uncaught TypeError: n.get is not a function". However, whenever I remove the data bind value from my code (leaving just the source), there is no errors thrown at all. I don't quite understand this error and why it would be throwing it.

9 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 04 May 2015, 08:50 AM
Hello George,

Could you provide a repro demo or steps to replicate the issue locally? This will help us to narrow the problem down and provide a fix much faster.

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Tony
Top achievements
Rank 1
answered on 07 May 2015, 12:50 AM

Hi Georgi,

Below is a snippet of the code in my html file. I have these items inside of a kendo template which the viewmodel is bound to:

<div class="col5-sm col16-md-4">
     <select class="cycle"
             data-role="combobox"
             data-text-field="name"
             data-value-field="value"
             data-bind="source: cycles, value: planDetails.selectedBillingCycleID">
      </select>
</div>

$(document).ready(function(){
        app.servicesPlansData.viewModel.getServicePlans(function() {
            kendo.bind($('#page-wrap'), app.servicesPlansData.viewModel);
        });
        
    });

 

And Below is part of the viewmodel i have created. I am working with a complex json object (which at the moment is locally stored. 

 

(function (global) {
  
var servicesPlansViewModel,
        app = global.app = global.app || {};
 
    servicesPlansViewModel = kendo.data.ObservableObject.extend({
        servicePlans : "",
        configDetails: "",
        cycles: [{ name: "Weekly", value: "Weekly" },
                { name: "Monthly", value: "Monthly" },
                { name: "Quarterly", value: "Quarterly" },
                { name: "Semi-Annually", value: "Semi-Annually" },
                { name: "Bi-Annually", value: "Bi-Annually" }],
        getServicePlans: function (callback) {
            var that = this;
 
            $.ajax({
                url: 'services-data.json',
                type: 'get',
                dataType: 'json',
                error: function(response){
                    console.log('error')
                },
                success: function(response){
                    that.set("servicePlans", response.sPlans);
                    callback();
                }
            });
        }
})  
 
    app.servicesPlansData = {
        viewModel: new servicesPlansViewModel()
    };
 
 })(window);

 

You're help is very much appreciated. 

 

Thanks.

0
Georgi Krustev
Telerik team
answered on 08 May 2015, 10:46 AM
Hello George,

I prepared a simple Dojo demo using the provided code snippet, but I couldn't replicate the issue. I suppose that the widget works as expected when the is bound directly. Would it be possible to modify the demo and replicate the issue?

As a side note, there is a known issue related to DDL and MVVM source binding with templates. If you think the depicted error is related, then upgrade to the next internal build that will be released till the end of week.

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Tony
Top achievements
Rank 1
answered on 08 May 2015, 07:56 PM

Hello Georgi,

 I am seeing this error in the console: "Uncaught TypeError: n.get is not a function". It appears your Dojo demo does replicate my exact issue. Would this be as a result to the known issue you pointed out?

0
Georgi Krustev
Telerik team
answered on 12 May 2015, 08:58 AM
Hello George,

I would suggest you upgrade to the latest internal build (2015.1.511) released last Friday, as the fix of the mentioned issue is included. If the problem still persists, then I suppose the issue is different and we will need repro demo that demonstrates the issue.

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Tony
Top achievements
Rank 1
answered on 12 May 2015, 07:19 PM

Hi Georgi,

It look like the latest build is 2015.1.429 ? I've updated my cdn file to point to this build and now i'm receiving this error:

Uncaught Error: Invalid template:'#:data.name#' Generated code:'var $kendoOutput, $kendoHtmlEncode = kendo.htmlEncode;with(data){$kendoOutput=''+$kendoHtmlEncode(data.name)+'';}return $kendoOutput;'

 

I'm not sure if this is related to the comboboxes?

0
Georgi Krustev
Telerik team
answered on 13 May 2015, 11:00 AM
Hello George,

The mentioned version does not include the fix. The latest internal build - 2015.1511 includes it. I would suggest you upgrade the scripts to that version.

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Tony
Top achievements
Rank 1
answered on 13 May 2015, 04:57 PM
I'm using a CDN. Has the latest internal build available as CDN? I am having trouble finding it.
0
Georgi Krustev
Telerik team
answered on 15 May 2015, 08:48 AM
Hi again,

We upload only official releases (quarter or service pack releases) on CDN. Internal builds are not uploaded. If you would like to use the internal build, you will need to host the script locally.

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
ComboBox
Asked by
Tony
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Tony
Top achievements
Rank 1
Share this question
or