b.slice is not a function?

6 posts, 0 answers
  1. T.
    T. avatar
    25 posts
    Member since:
    Aug 2012

    Posted 24 Aug 2012 Link to this post

    Hi all,

    I am trying to get an XML datasource working, but unfortunately without success.
    The XML-data I provided locally in a variable. The whole code is below.

    If I load the page firebug comes up with an error message:

    b.slice is not a function.

    Can anyone assist please?
    Thanks for any help!


    <html>
      <head>
        <link href="/css/kendo/styles/kendo.common.min.css" rel="stylesheet" type="text/css" />
        <link href="/css/kendo/styles/kendo.default.min.css" rel="stylesheet" type="text/css" />
        <!--link href="/css/kendo/styles/kendo.dataviz.min.css" rel="stylesheet" type="text/css" /-->
     
     
        <script src="/js/kendo/js/jquery.min.js" type="text/javascript"></script>
        <script src="/js/kendo/js/kendo.web.min.js" type="text/javascript"></script>
             
      </head>
      <body>
        <div id="grid">
        </div>
      </body>
      <script type="text/javascript">
      $(
        function()
        {
            var dsXMLData = "<items><Item><No>4711</No><Description>Artikel 4711</Description><UnitPrice>12.34</UnitPrice></Item><Item><No>4712</No><Description>Artikel 4712</Description><UnitPrice>24.68</UnitPrice></Item></items>";
                 
            var dsXML = new kendo.data.DataSource (
            {
                data: dsXMLData,
                schema:
                {
                    type: 'xml',
                    data: '/items/Item',
                    model:
                    {
                        fields:
                        {
                            itemno:         { field: "No/text()" },
                            description:    { field: "Description/text()" },
                            unitprice:      { field: "UnitPrice/text()"  }
                        }
                    }
                }
            });
     
            dsXML.read();
             
            $("#grid").kendoGrid(
            {
                columns: [{title: "Artikel Nr.", field: "itemno"},
                          {title: "Beschreibung", field: "description"},
                          {title: "VK-Preis", field: "unitprice"}],
                             
                dataSource:
                {
                    data: dsXML
                }
            });
             
         
        }
      );
      </script>
    </html>

  2. T.
    T. avatar
    25 posts
    Member since:
    Aug 2012

    Posted 31 Aug 2012 Link to this post

    Hi,

    since one week no response, still need help, thanks!
  3. Kendo UI is VS 2017 Ready
  4. Shane
    Shane avatar
    5 posts
    Member since:
    Feb 2012

    Posted 04 Sep 2012 Link to this post

    You need to change 

    dataSource:
         {
         data: dsXML
     }

    to: 

    dataSource: dsXML  
  5. T.
    T. avatar
    25 posts
    Member since:
    Aug 2012

    Posted 14 Sep 2012 Link to this post

    Hi Shane,

    sorry for answering so lately!
    What you suggested solved my problem,

    many thanks!
  6. Jeremy
    Jeremy avatar
    55 posts
    Member since:
    Nov 2011

    Posted 29 Apr 2015 in reply to Shane Link to this post

    Ha! Me too! Thanks for posting this three years ago. I just ran into the same thing and you solved it.
  7. nitesh
    nitesh avatar
    3 posts
    Member since:
    Oct 2016

    Posted 01 Nov Link to this post

    TypeError: e.options.tools.slice is not a function
  8. nitesh
    nitesh avatar
    3 posts
    Member since:
    Oct 2016

    Posted 01 Nov Link to this post

    TypeError: e.options.tools.slice is not a function  while upgrading kendo.all.min.js v2015.2.624 to Q@ 2016
Back to Top
Kendo UI is VS 2017 Ready