Git Product home page Git Product logo

Comments (4)

errorrik avatar errorrik commented on July 23, 2024

当expand事件发生时,需要根据数据的获取方案来提供不同的逻辑,一般如下:

如果数据是静态的,则直接调用expandNode,不传递children参数,由控件自动查找数据并生成子节点。
如果数据是远程加载的,则:
调用indicateNodeLoading方法,使节点进入加载状态。
通过XMLHttpRequest等手段加载远程数据,在收到数据后,调用expandNode并传递children参数展开节点。

动态数据,如果已经加载过,存在哪里?如何判断已经存在?

from esui.

otakustay avatar otakustay commented on July 23, 2024

加载的数据放在哪是由Strategy的实现决定的,当然推荐直接作为节点的数据对象的children属性放着,这个需要写到标准里吗

from esui.

errorrik avatar errorrik commented on July 23, 2024

类似这样?

node.children = ...

如果是的话,建议写到标准里哈

from esui.

otakustay avatar otakustay commented on July 23, 2024

已补充,控件本身是会把children挂到节点的数据上的,不需要Strategy的实现来管。

from esui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.