jQWidgets Forums
jQuery UI Widgets › Forums › React › problem with the let dataAdapter = new $.jqx.dataAdapter(source);
Tagged: react $.jqx.dataAdapter
This topic contains 8 replies, has 3 voices, and was last updated by assembler 7 years, 7 months ago.
-
Author
-
October 17, 2017 at 2:33 pm problem with the let dataAdapter = new $.jqx.dataAdapter(source); #96765
Hi everybody! I’ve downloaded jqWidgets for testing it. I’ve followed the instructions to get it working and it works, for the first render only.
I import thejqxcore.js
,jqxdata.js
andjqxtree.js
files in my index.html file. Then I importreact_jqxtree.js
file in my custom React component.
Calling thelet dataAdapter = new $.jqx.dataAdapter(source);
for the first time it shows me the tree, however I’m gettingUncaught (in promise) TypeError: Cannot read property ‘dataAdapter’ of undefined
on page refresh or if render is called again.
What am I missing here? I’m very new to jQuery, but skilled on React.
Best regars, Assembler
October 17, 2017 at 2:41 pm problem with the let dataAdapter = new $.jqx.dataAdapter(source); #96766Hi assembler,
Look at: https://www.jqwidgets.com/react/react-tree/react-tree-jsontree.htm. The JS files are added not as imports. May be this matters. Also it is not necessary to use $, you can use jqx.dataAdapter, too.
Best Regards,
Peter StoevjQWidgets Team
https://www.jqwidgets.com/October 17, 2017 at 2:46 pm problem with the let dataAdapter = new $.jqx.dataAdapter(source); #96767Hi, Mr. Peter Stoev,
That is the way I’m adding the framework files into my
index.html
file. I tried both$.jqx...
andjqx...
and no matter what it keeps rendering just once.Would that be a licensing trouble?
Best regards!
October 17, 2017 at 3:13 pm problem with the let dataAdapter = new $.jqx.dataAdapter(source); #96770Hi assembler,
No, licensing does not matter here. What means the first time it shows the Tree. How many times should it be rendered?
Best Regards,
Peter StoevjQWidgets Team
https://www.jqwidgets.com/October 17, 2017 at 3:38 pm problem with the let dataAdapter = new $.jqx.dataAdapter(source); #96772Hi Mr. Peter Stoev,
Sorry for my delay. I’m trying to populate the tree on demand, so, it’ll be rendered as many times as the tree fetches data from the rest api.
my best regards
October 17, 2017 at 10:33 pm problem with the let dataAdapter = new $.jqx.dataAdapter(source); #96777Do it like this:
let dataAdapter = new window.$.jqx.dataAdapter(source);
For more info see this thread: create-react-app – jqx.dataAdapter
October 18, 2017 at 2:37 pm problem with the let dataAdapter = new $.jqx.dataAdapter(source); #96798Mr. AsterionDB and Mr. Stoev, thanks for your responses. It didn’t work as expected for me. I’m assuming there is something I’m doing wrong, so I’m checking my entire code.
October 18, 2017 at 8:07 pm problem with the let dataAdapter = new $.jqx.dataAdapter(source); #96804OK…that ‘window.$’ thing tripped me up for a few days.
Seems to me that the dataAdapter variable you have defined has gone out of scope (i.e. not defined within the scope of the promise). You may need to ‘bind(this)’ up.
October 23, 2017 at 2:59 pm problem with the let dataAdapter = new $.jqx.dataAdapter(source); #96876Mr. AsterionDB, I want to say that I was struggling with Jqxwidgets, but the main trouble was on my side. I was using an old project for testing React components in order to use another palette. I decided to make a clear brand new React project, this time with Boilerplate and then it worked as expected. Have a nice day!
-
AuthorPosts
You must be logged in to reply to this topic.