Open xgqfrms opened 6 years ago
no way, it just a customize
key
.
https://www.w3schools.com/jsref/prop_element_classlist.asp
https://developer.mozilla.org/en-US/docs/Web/API/Element/classList
tooltip: function(event, data) {
var node = data.node;
// console.log(`tooltip data`, data);
// console.log(`tooltip data.node`, data.node);
// set customize class
if (data.node.data.changed) {
data.node.span.dataset.testTootip = ("test-tooltip");
// data.node.span.classList.add("666");
return `已修改结点: ${data.node.title}`;
} else {
// no need
// return data.node.title;
return false;
}
// return data.node.title + "test-tooltip";
},
scollBox
https://stackoverflow.com/questions/11715646/scroll-automatically-to-the-bottom-of-the-page
// js auto scroll to page bottom
// window.scrollTo(0, sectionContent.scrollHeight);
sectionContent.scrollTo(0, sectionContent.scrollHeight);
// sectionContent.scrollTo(0, progressTbody.scrollHeight);
// console.log(`progressTbody.scrollHeight =`, progressTbody.scrollHeight);
// window.scrollTo(0, document.body.scrollHeight);
// window.scrollTo(0, document.querySelector(".scrollingContainer").scrollHeight);
https://egghead.io/lessons/react-use-react-ref-to-get-a-reference-to-specific-components
class SayHello extends React.Component {
constructor(props) {
super(props);
this.state = {
message: 'Hello!'
};
// constructor bind(this)
this.handleClick = this.handleClick.bind(this);
}
handleClick() {
alert(this.state.message);
}
// WARNING: this syntax is experimental! Using an arrow here binds the method:
// ES7 bind(this)
ES7_handleClick = () => {
alert(this.state.message);
};
render() {
return (
<div>
<button onClick={this.handleClick}>
ES6 constructor
</button>
{/*ES6 bind(this) onClick={(e) => this.handleClick(e)} */}
<button onClick={() => this.handleClick()}>
ES6 Arrow Function
</button>
<button onClick={this.ES7_handleClick}>
ES7 class properties
</button>
<section data-box="section">...Todo</section>
</div>
);
}
}
const app = `mountNode`;
// ReactDOM.render(component, app_container[, callback])
const callback_func = (e) => {
// console.log(`e = `, e);
// let box = document.querySelector(`[data-box="section"]`);
// box.innerHTML = `e.target.dataset: ${e.target.dataset}`;
};
ReactDOM.render(<SayHello />, mountNode, callback_func);
element.appendChild(fragment);
https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment https://developer.mozilla.org/en-US/docs/Web/API/Document/createDocumentFragment
// <ul id="ul"></ul>
var element = document.getElementById('ul'); // assuming ul exists
var fragment = document.createDocumentFragment();
var browsers = ['Firefox', 'Chrome', 'Opera',
'Safari', 'Internet Explorer'];
browsers.forEach(function(browser) {
var li = document.createElement('li');
li.textContent = browser;
fragment.appendChild(li);
});
element.appendChild(fragment);
fancytree & customize status icon
https://github.com/mar10/fancytree/
docs
https://github.com/mar10/fancytree/wiki#configure-options
http://www.wwwendt.de/tech/fancytree/doc/jsdoc/Fancytree_Static.html
http://wwwendt.de/tech/fancytree/doc/jsdoc/global.html#FancytreeOptions http://www.wwwendt.de/tech/fancytree/doc/jsdoc/global.html#FancytreeOptions
external
OK
https://github.com/mar10/fancytree/issues/867
http://wwwendt.de/tech/fancytree/demo/sample.js http://wwwendt.de/tech/fancytree/demo/sample.css