javascript - cytoscape js updating node label dynamically with fontawesome -


example:

https://jsfiddle.net/bababalcksheep/ajhnmcrb/16/

what needed: want dynamically change content name of node , want use font awesome icon unicode in it.

tries: if use content: '\uf173' , font renders correctly. if want update node label new font unicode, not work. prints \uf173 instead of font

i using input <input type="text" value="\uf173" id="title"> change node id e cy.$('#e') change content.

   $('#title').on('input', function() {           cy.$('#e').css({           content:   $('#title').val()         });    }); 

a unicode escape character should work in html value if it's specified in code. if type \uf173 in input has value '\\uf173'. you'll have parse if want recognise similar typed string unicode escape value. or you'll have have user type real value want using kind of os system key sequence.

or append value. wouldn't expect user typing in things that: label: function( node ){ return '\uf173' + node.data('label'); }


Comments

Popular posts from this blog

cookies - Yii2 Advanced - Share session between frontend and mainsite (duplicate of frontend for www) -

angular - password and confirm password field validation angular2 reactive forms -

php - Permission denied. Laravel linux server -