javascript error - Uncaught TypeError - I can not solve

0

It gives me the following error: Uncaught TypeError: undefined is not a function. I still can not figure it out. I have already changed the jquery versions and nothing. I looked for quotes, semicolon errors and even then I still can not solve. The error goes in this line of my jquery function: $('#jqxTree').jqxTree({ height: '400px', hasThreeStates: true, checkboxes: true, width: '330px' });

This is a code I got on the net. In an HTML page it worked, even was part of another post of mine that I gave as terminated by the response found. But now that I'm moving on to my view (cshtml) is that it started to stick. There were 9 errors and 8 were solved, but that still could not solve. I've had other problems elsewhere, with this same error, but this time I can not. Here is a print of the page at the time of the error:

Belowismyjqueryfunctionandmycshtml.

$(document).ready(function(){//createjqxTree$('#jqxTree').jqxTree({height:'400px',hasThreeStates:true,checkboxes:true,width:'330px'});$('#jqxTree').css('visibility','visible');$('#jqxCheckBox').jqxCheckBox({width:'200px',height:'25px',checked:true});$('#jqxCheckBox').on('change',function(event){varchecked=event.args.checked;$('#jqxTree').jqxTree({hasThreeStates:checked});});$("#jqxTree").jqxTree('selectItem', $("#home")[0]);

    $('label.tree-toggler').click(function () {
        $(this).parent().children('ul.tree').toggle(300);
    });

});

My cshtml:

@{
    ViewBag.Title = "Acao";
    Layout = "~/Views/Shared/_LayoutBase.cshtml";
}

<link href="~/Content/Jqwidgets/jqx.base.css" rel="stylesheet" type="text/css" />

<h2>Tomada de Ação</h2>

<div class="row">
    <div class="col-md-12">
        <div class="col-md-1">
            <label for="cbxCodTipo">UF:</label>
        </div>
        <div class="col-md-4">
            <select class="form-control col-md-6" name="cbxCodTipo" id="cbxCodTipo" onchange=" return MontaCidades();">
                <option value="00">Selecione um estado</option>
                <option value="AC">ACRE</option>
                <option value="AL">ALAGOAS</option>
                <option value="AP">AMAPÁ</option>
                <option value="AM">AMAZONAS</option>
                <option value="BA">BAHIA</option>
                <option value="CE">CEARÁ</option>
                <option value="DF">DISTRITO FEDERAL</option>
                <option value="ES">ESPÍRITO SANTO</option>
                <option value="GO">GOIÁS</option>
                <option value="MA">MARANHÃO</option>
                <option value="MT">MATO GROSSO</option>
                <option value="MS">MATO GROSSO DO SUL</option>
                <option value="MG">MINAS GERAIS</option>
                <option value="PA">PARÁ</option>
                <option value="PB">PARAÍBA</option>
                <option value="PR">PARANÁ</option>
                <option value="PE">PERNAMBUCO</option>
                <option value="PI">PIAUÍ</option>
                <option value="RJ">RIO DE JANEIRO</option>
                <option value="RN">RIO GRANDE DO NORTE</option>
                <option value="RS">RIO GRANDE DO SUL</option>
                <option value="RO">RONDÔNIA</option>
                <option value="RR">RORAIMA</option>
                <option value="SC">SANTA CATARINA</option>
                <option value="SP">SÃO PAULO</option>
                <option value="SE">SERGIPE</option>
                <option value="TO">TOCANTINS</option>
            </select>
        </div>
        <div class="col-md-6">
            <div class="col-md-2">
                <label for="cbxCidade">Cidade:</label>
            </div>
            <select class="form-control col-md-4" name="cbxCidade" id="cbxCidade"></select>
        </div>
    </div>

    <div class="col-md-12">
        <div class="col-md-1">
            <label for="cbxRede">Rede:</label>
        </div>
        <div class="col-md-4">
            <select class="form-control col-md-6" name="cbxRede" id="cbxRede"></select>
        </div>
        <div class="col-md-6">
            <div class="col-md-2">
                <label for="cbxRede">Descrição:</label>
            </div>
            <select class="form-control col-md-4" name="cbxDescricao" id="cbxDescricao"></select>
        </div>
    </div>

    <div class="col-md-12">
        <div class="col-md-1">
            <label for="cbxProduto">Produto:</label>
        </div>
        <div class="col-md-4">
            <select class="form-control col-md-6" name="cbxProduto" id="cbxProduto"></select>
        </div>
    </div>

    <div class="col-md-12">
        <div class="col-md-1">
            <label for="cbxUnNegocio">Unidade Negócio:</label>
        </div>
        <div class="col-md-4">
            <select class="form-control col-md-6" name="cbxUnNegocio" id="cbxUnNegocio"></select>
        </div>
    </div>
</div>
<br />

<div id="content">
    <div class="listTree"></div>
    <button class="btn btn-primary" onclick=" return CadastraUsuario();">Pesquisar</button>
</div>
<br>
<div id='jqxWidget'>
<div style='float: left;'>
    <div id='jqxTree' style='visibility: hidden; float: left; margin-left: 20px;'>
        <ul>
            <li item-checked='true' item-expanded='true'>
                Solutions
                <ul>
                    <li>Education</li>
                    <li>Financial services</li>
                    <li>Government</li>
                    <li item-checked='false'>Manufacturing</li>
                    <li>
                        Solutions
                        <ul>
                            <li>Consumer photo and video</li>
                            <li>Mobile</li>
                            <li>Rich Internet applications</li>
                            <li>Technical communication</li>
                            <li>Training and eLearning</li>
                            <li>Web conferencing</li>
                        </ul>
                    </li>
                    <li>All industries and solutions</li>
                </ul>
            </li>
            <li>
                Products
                <ul>
                    <li>PC products</li>
                    <li>Mobile products</li>
                    <li>All products</li>
                </ul>
            </li>
            <li>
                Support
                <ul>
                    <li>Support home</li>
                    <li>Customer Service</li>
                    <li>Knowledge base</li>
                    <li>Books</li>
                    <li>Training and certification</li>
                    <li>Support programs</li>
                    <li>Forums</li>
                    <li>Documentation</li>
                    <li>Updates</li>
                </ul>
            </li>
            <li>
                Communities
                <ul>
                    <li>Designers</li>
                    <li>Developers</li>
                    <li>Educators and students</li>
                    <li>Partners</li>
                    <li>
                        By resource
                        <ul>
                            <li>Labs</li>
                            <li>TV</li>
                            <li>Forums</li>
                            <li>Exchange</li>
                            <li>Blogs</li>
                            <li>Experience Design</li>
                        </ul>
                    </li>
                </ul>
            </li>
            <li>
                Company
                <ul>
                    <li>About Us</li>
                    <li>Press</li>
                    <li>Investor Relations</li>
                    <li>Corporate Affairs</li>
                    <li>Careers</li>
                    <li>Showcase</li>
                    <li>Events</li>
                    <li>Contact Us</li>
                    <li>Become an affiliate</li>
                </ul>
            </li>
        </ul>
    </div>

    <div style='margin-left: 60px; float: left;'>
        <div style='margin-top: 10px;'>
            <input id='jqxCheckBox' type="hidden">
        </div>
    </div>
</div>
    </div>

    <div class="row">
        <div class="col-md-12">
            <div class="col-md-2">
                <label for="txtObs">Observação:</label>
            </div>
            <div class="col-md-12">
                <textarea id="txtObs" style="width: 450px;"></textarea>
            </div>
        </div>
    </div>

    <br />

    <div id="content">
        <div class="listTree"></div>
        <button class="btn btn-success" ">Gravar</button>
        @Html.ActionLink("Voltar", "Index", "Home", new { }, new { @class = "btn btn-danger" })
    </div>

    @*<script class="cssdeck" src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>*@
    <script class="cssdeck" src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.1/js/bootstrap.min.js"></script>

    <script src="~/Scripts/jquery-2.1.0.min.js"></script>
    <script src="~/Scripts/Acao/Acao.js"></script>
    <script src="~/Scripts/Util.js"></script>



    <script src="~/Scripts/Jqwidgets/jqxcore.js"></script>
    <script src="~/Scripts/Jqwidgets/jqxbuttons.js"></script>
    <script src="~/Scripts/Jqwidgets/jqxscrollbar.js"></script>
    <script src="~/Scripts/Jqwidgets/jqxpanel.js"></script>
    <script src="~/Scripts/Jqwidgets/jqxtree.js"></script>
    <script src="~/Scripts/Jqwidgets/jqxcheckbox.js"></script>
    
asked by anonymous 09.09.2014 / 15:46

1 answer

1

I put a $ inside the function and it worked, but I do not know if it would be the correct one.

So it was my function:

$(document).ready(function ($) { ... }); 
    
09.09.2014 / 17:52