n.get is not a function

10 posts, 0 answers
  1. George
    George avatar
    49 posts
    Member since:
    Apr 2014

    Posted 30 Apr 2015 Link to this post

    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.
  2. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3706 posts

    Posted 04 May 2015 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
  4. George
    George avatar
    49 posts
    Member since:
    Apr 2014

    Posted 06 May 2015 in reply to Georgi Krustev Link to this post

    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.

  5. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3706 posts

    Posted 08 May 2015 Link to this post

    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!
     
  6. George
    George avatar
    49 posts
    Member since:
    Apr 2014

    Posted 08 May 2015 in reply to Georgi Krustev Link to this post

    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?

  7. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3706 posts

    Posted 12 May 2015 Link to this post

    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!
     
  8. George
    George avatar
    49 posts
    Member since:
    Apr 2014

    Posted 12 May 2015 in reply to Georgi Krustev Link to this post

    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?

  9. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3706 posts

    Posted 13 May 2015 Link to this post

    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!
     
  10. George
    George avatar
    49 posts
    Member since:
    Apr 2014

    Posted 13 May 2015 in reply to Georgi Krustev Link to this post

    I'm using a CDN. Has the latest internal build available as CDN? I am having trouble finding it.
  11. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3706 posts

    Posted 15 May 2015 Link to this post

    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!
     
Back to Top
Kendo UI is VS 2017 Ready