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

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -