jQWidgets Forums

jQuery UI Widgets Forums Getting Started Problem using React Menu demo…

Tagged: 

This topic contains 2 replies, has 2 voices, and was last updated by  asvarcas 6 years, 7 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Problem using React Menu demo… #102675

    asvarcas
    Participant

    Using this demo:
    https://www.jqwidgets.com/react/react-menu/react-menu-jsonmenu.htm

    I’m trying to bring the demo to my workspace and React tells me that ‘$’ is undefined at this code:

    `// create data adapter.
    dataAdapter = new $.jqx.dataAdapter(source);`

    I know this is jQuery but i don’t get where it is.

    If you can help my…

    Thank you.

    Problem using React Menu demo… #102677

    Peter Stoev
    Keymaster

    Hi asvarcas,

    Remove the $ symbol. We do not use jQuery anymore.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    https://www.jqwidgets.com

    Problem using React Menu demo… #102693

    asvarcas
    Participant

    I thank you for your response.
    But the documentation and examples are full of jQuery snippets and is incomplete.
    Only in the jQuery documentation can i find JqxDataAdapter API reference and is not clear how to use it in React.

    I tried:

    // prepare the data
            let source =
                {
                    datatype: 'json',
                    datafields: [
                        {name: 'id'},
                        {name: 'parentid'},
                        {name: 'text'},
                        {name: 'subMenuWidth'}
                    ],
                    id: 'id',
                    localdata: data
                };
    
    // create data adapter.
    let dataAdapter = React.createElement(JqxDataAdapter, source);
    
    // perform Data Binding.
    dataAdapter.dataBind();

    And i get “Warning: React.createElement: type is invalid” error.
    I don’t get where to import it from.
    I tried with:
    import JqxDataAdapter from './assets/jqwidgets/jqxdata.js'; and
    import JqxDataAdapter from './assets/jqwidgets/jqx-all.js';

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.