How do I run react-data-grid examples on jsfiddle? - reactjs

I am trying to get a hang of react-data-grid and the examples on their page have a "play around with it" link that takes you to jsfiddle. For some reason, I am unable to see the output on jsfiddle.
What would be a solution for this?

Some of the dependencies are deprecated in the latest react version used by jsfiddle. On inspecting the resources accessed by their page and comparing it with fiddle, you can hack a solution by doing the following in jsfiddle :
remove react-with-addons.js and react-dom.js from external resources tab.
add react.min.js and react-dom.min.js in external resources.
replace jsfiddle-integration-babel.js in script with this.
Try this fork. It doesn't update contents in table, which is the same state as in page.

Related

Full Calendar 3.5.0 in JSFiddle Doesn't Work

As Full Calendar 3.5.0 recently came out, I wanted to try it on JSFiddle.
I linked all the necessary external links from CDNJS.
However, the
<div id='calendar'>
in the HTML of which in my JSFiddle does not work.
I am a beginner. I thought that CALENDAR ID was in the JS.
Has anyone tried the full calendar 3.5.0?
The calendar is not shown!
This is the link to the JSFiddle: Link
Thank you for your support in advance!!
When running your fiddle, check the browser console for errors. It'll tell you jQuery is not defined when fullCalendar is trying to use it. This is because fullCalendar relies on jQuery, but you loaded the fullCalendar library before the jQuery library, so fullCalendar can't find jQuery when it loads, because it doesn't exist yet.
You added the JS files in the wrong order, and you forgot to include momentJS at all. https://fullcalendar.io/docs/usage/ tells you what to include and what order to put them in.
jQuery and Moment must be loaded before FullCalendar's JavaScript.
To fix:
1) Add a reference to momentJS
2) Re-order the references as per the fullCalendar docs. In JSFiddle you simply
click the External Resources zone and then drag them into the correct order.
3) You included fullCalendar twice. You only need to include the fullCalendar.min.js. The only reason to use the full-fat fullCalendar.js is if you want to debug it, otherwise it just wastes bandwidth, and certainly should never include them both together (or include the same one twice), or else you risk conflicts.
Check the same thing with CSS as well - you also included fullCalendar.css and fullCalendar.min.css, which makes no sense for the same reasons as I outlined above with the JS files.

initialize onsenui after document loaded

i´m trying to initialize onsenui after some js files are loaded, but then
ons.bootstrap() is causing the errors.
when i´m using a sample from onsenui everything is working quite good, but in my
project, i have to load the js files dynamically and synchronously
and then ons.bootstrap(); give me the this error
"'AppController' is not a function, got undefined"
if same js libs in same order are declared in html doc with script tags everything is working good.
i´ve found that if the scripts are loading through normal script tags and then i´m waiting till html document is fully loaded and then call ons.bootstrap() through developer tools i got same error.
so the question is how to initlaize onsen ui after document is loaded?
Hope someone can help, I´m not very familiar with angularJS/OnsenUi... first project
thanks
I have create 2 samples to demonstrate my problem.
working like onsenui samples.
jbBgmd http://codepen.io/anon/pen/jbBgmd
not working like in my case.
BoWXdP http://codepen.io/anon/pen/BoWXdP
any idea?
You are trying to load Onsen after the elements have been rendered, that's why it gave an error. You should always execute Onsen before the components are rendered.
If you want to execute some code after the DOM has been loaded, you should use ons.ready() function, you can take a look at it in the official documentation.
Here you can find the fixed and working CodePen: http://codepen.io/andipavllo/pen/ZbKzRy
Here is the edited JS:
ons.bootstrap().controller("appController", function ()
{
ons.ready(function(){
console.log("works")
})
});
Hope it helps!

angular js template with routing and translate refusing to work

I am new to angular and it seems very interesting
I am creating a template for a promotional page and struggling to understand what is causing an issue on it - half of the script stopped working...
My fiddle is in here see >
fiddle example
or Plunker
I have working example without route...
Can you advice me how to fix this issue please
First of all, i'd suggest you to separate your project to different files based on best practises
Secondly, 'config, controller, factory' etc are methods of angular.module object. So you need to retrieve it first like
angular.module('<moduleName>').config(...)
or use some variable.
http://plnkr.co/edit/CK5R2cS7Zd9T9Kun9Epc?p=preview

Is AngularRoute.js is Mandatory for routing in Angular js

i am new to angular js .
Please help me.
i readed some blogs on angular views and route and i implemented the code for view and route .
the code was not working. As I include angularoute.js to code then it works fine for me .
But in all the blogs they are not including the angularoute.js to code.
So my question is that is route logic was removed from angular.js or i am doing something wrong.
In angular 1.0, routing was part of the core angular.js module. Since 1.2, they've made it an external module, in an external file. What you're doing is thus fine, and the blogs you read have probably been written before angular 1.2, or neglected to precise that this additional file had to be added.
The official documentation is quite clear about it, though:
First include angular-route.js in your HTML:
<script src="angular.js">
<script src="angular-route.js">
...
I strongly suggest you to use aungular-ui-router. Basically it's the same as angular-route but it has much much more features. There are the nested views option, also you can pass parameters over different states. You can easily assert in which state you are and based on that change the view or do something else. Another aswe feature is that you can have multiple named view on a single page which means you can load different templates on this page. The documentation is pretty awesome with this one as well. You might want to take a look. Also when you have some issues you better paste some code so people could see where could something possibly be wrong.
The Angular UI - 3rd party lib.

Adding an ng-click event inside a filter

I'm fairly new to Angular but I've been using it the past few weeks and have managed to work out most of the problems I've come across. This one however has me stumped.
I have an app that pulls in tweets from Twitter then - using an angular filter - pulls out all the urls and styles them as links. This part works fine but the client decided that links from Twitter were't safe so they wanted a disclaimer to fire every time a link was clicked. Simple enough - I hijacked the link and swapped the href for an ng-click="openLink('url')". This is where the problem occurred - the ng-click doesn't work.
I'm pretty sure the problem has something to do with $compile() - I've had similar issues before - but I have no idea when or where to call it.
I've created a Plunkr that is a lite version of what I'm after. The link at the top isn't loaded in dynamically and fires the alertUrl() function fine, but all the links generated by the filter fail.
I'm probably missing something really simple but it's been bugging me a while now so any help will be massively appreciated.
Thanks,
Sam
Well you are correct that the html\content that you emit needs to be compiled for angularjs to resolve the alert function.
I have changed your plunker, and inject a compile directive (from here)
See it in action here
The basic idea here is to compile the content produced from twitter feed dynamically.
<p compile="tweet.text | convertLinks"></p>

Resources