Loading ...
Sorry, an error occurred while loading the content.

Re: [ydn-javascript] Dynamic Treeview from/to Remote Site via XHR

Expand Messages
  • Satyam
    Starting with 2.6, TreeView has method getTreeDefintion which produces an object which can be serialized via the JSON utility to be stored wherever. The
    Message 1 of 5 , Dec 1, 2008
    View Source
    • 0 Attachment
      Starting with 2.6, TreeView has method getTreeDefintion which produces
      an object which can be serialized via the JSON utility to be stored
      wherever. The object literal produced should reflect the state of the
      tree. This same object can be provided as the second argument to the
      TreeView constructor and the same tree will be created.

      In the example at:

      http://developer.yahoo.com/yui/examples/treeview/tv-markup.html

      the second is made from the definition of the first. The third tree is
      made of the definition of a branch.

      Satyam


      Caxton wrote:
      > Dear all:
      >
      > It is convenient to use Treeview and load data via XHR(YUI Connection
      > Management) dynamically.
      >
      > However, I have no idea how to save change of Treeview.
      >
      > For example, how to save new label of the node when using inline
      > editing of Treeview?
      >
      > In addition, when Treeview combine with Drag and Drop, how to save the new
      > order of the Treeview?
      >
      > For example 1, I think the key is detecting user press tick button.
      > For example 2, I am not sure, but maybe it is possible to construct
      > Treeview structure and translate it into XML or JSON format.
      >
      > Please give me a hand, thanks.
      >
      > Best Regards,
      >
      > Caxton
      >
      >
      > ------------------------------------
      >
      > Yahoo! Groups Links
      >
      >
      >
      > ------------------------------------------------------------------------
      >
      >
      > No virus found in this incoming message.
      > Checked by AVG - http://www.avg.com
      > Version: 8.0.175 / Virus Database: 270.9.11/1820 - Release Date: 29/11/2008 18:52
      >
      >
    • Caxton
      Dear Satyam: How to serialize the object via JSON utility? I can not find example in JSON Utility page. Thanks for reply! best regards, Caxton ... the new ...
      Message 2 of 5 , Dec 2, 2008
      View Source
      • 0 Attachment
        Dear Satyam:

        How to serialize the object via JSON utility?
        I can not find example in JSON Utility page.
        Thanks for reply!

        best regards,

        Caxton

        --- In ydn-javascript@yahoogroups.com, Satyam <satyam@...> wrote:
        >
        > Starting with 2.6, TreeView has method getTreeDefintion which produces
        > an object which can be serialized via the JSON utility to be stored
        > wherever. The object literal produced should reflect the state of the
        > tree. This same object can be provided as the second argument to the
        > TreeView constructor and the same tree will be created.
        >
        > In the example at:
        >
        > http://developer.yahoo.com/yui/examples/treeview/tv-markup.html
        >
        > the second is made from the definition of the first. The third tree is
        > made of the definition of a branch.
        >
        > Satyam
        >
        >
        > Caxton wrote:
        > > Dear all:
        > >
        > > It is convenient to use Treeview and load data via XHR(YUI Connection
        > > Management) dynamically.
        > >
        > > However, I have no idea how to save change of Treeview.
        > >
        > > For example, how to save new label of the node when using inline
        > > editing of Treeview?
        > >
        > > In addition, when Treeview combine with Drag and Drop, how to save
        the new
        > > order of the Treeview?
        > >
        > > For example 1, I think the key is detecting user press tick button.
        > > For example 2, I am not sure, but maybe it is possible to construct
        > > Treeview structure and translate it into XML or JSON format.
        > >
        > > Please give me a hand, thanks.
        > >
        > > Best Regards,
        > >
        > > Caxton
        > >
        > >
        > > ------------------------------------
        > >
        > > Yahoo! Groups Links
        > >
        > >
        > >
        > >
        ------------------------------------------------------------------------
        > >
        > >
        > > No virus found in this incoming message.
        > > Checked by AVG - http://www.avg.com
        > > Version: 8.0.175 / Virus Database: 270.9.11/1820 - Release Date:
        29/11/2008 18:52
        > >
        > >
        >
      • Caxton
        Sorry, I found that JSON method stringify can turn JavaScript data into a JSON string. Thanks again. Caxton ... produces ... the ... tree is ... Connection
        Message 3 of 5 , Dec 3, 2008
        View Source
        • 0 Attachment
          Sorry, I found that JSON method stringify can turn JavaScript data
          into a JSON string.

          Thanks again.

          Caxton

          --- In ydn-javascript@yahoogroups.com, "Caxton" <ivy_ckf@...> wrote:
          >
          > Dear Satyam:
          >
          > How to serialize the object via JSON utility?
          > I can not find example in JSON Utility page.
          > Thanks for reply!
          >
          > best regards,
          >
          > Caxton
          >
          > --- In ydn-javascript@yahoogroups.com, Satyam <satyam@> wrote:
          > >
          > > Starting with 2.6, TreeView has method getTreeDefintion which
          produces
          > > an object which can be serialized via the JSON utility to be stored
          > > wherever. The object literal produced should reflect the state of
          the
          > > tree. This same object can be provided as the second argument to the
          > > TreeView constructor and the same tree will be created.
          > >
          > > In the example at:
          > >
          > > http://developer.yahoo.com/yui/examples/treeview/tv-markup.html
          > >
          > > the second is made from the definition of the first. The third
          tree is
          > > made of the definition of a branch.
          > >
          > > Satyam
          > >
          > >
          > > Caxton wrote:
          > > > Dear all:
          > > >
          > > > It is convenient to use Treeview and load data via XHR(YUI
          Connection
          > > > Management) dynamically.
          > > >
          > > > However, I have no idea how to save change of Treeview.
          > > >
          > > > For example, how to save new label of the node when using inline
          > > > editing of Treeview?
          > > >
          > > > In addition, when Treeview combine with Drag and Drop, how to save
          > the new
          > > > order of the Treeview?
          > > >
          > > > For example 1, I think the key is detecting user press tick button.
          > > > For example 2, I am not sure, but maybe it is possible to construct
          > > > Treeview structure and translate it into XML or JSON format.
          > > >
          > > > Please give me a hand, thanks.
          > > >
          > > > Best Regards,
          > > >
          > > > Caxton
          > > >
          > > >
          > > > ------------------------------------
          > > >
          > > > Yahoo! Groups Links
          > > >
          > > >
          > > >
          > > >
          > ------------------------------------------------------------------------
          > > >
          > > >
          > > > No virus found in this incoming message.
          > > > Checked by AVG - http://www.avg.com
          > > > Version: 8.0.175 / Virus Database: 270.9.11/1820 - Release Date:
          > 29/11/2008 18:52
          > > >
          > > >
          > >
          >
        • simonjwoodman
          Hi, did you manage to figure out how to do example 1? I have a requirement to do the same thing. In my case, my treeview represents a file structure. I d
          Message 4 of 5 , Dec 3, 2008
          View Source
          • 0 Attachment
            Hi,

            did you manage to figure out how to do example 1? I have a
            requirement to do the same thing. In my case, my treeview represents
            a file structure. I'd like to allow inline editing of the Nodes
            within a tree to rename files. Ideally, I'd like to intercept the
            user's click on the tick and only update the Treeview Node after an
            XHR call to rename the file on the server.

            Any ideas?

            I could provide a 'save changes' function that serialised the
            treeview to JSON and sent it to the server. However, then it would
            be necessary to work out what had been changed. This seems like a
            bit of a hack and not a very efficient one.

            Thanks in advance,

            Simon


            --- In ydn-javascript@yahoogroups.com, "Caxton" <ivy_ckf@...> wrote:
            >
            > Dear all:
            >
            > It is convenient to use Treeview and load data via XHR(YUI
            Connection
            > Management) dynamically.
            >
            > However, I have no idea how to save change of Treeview.
            >
            > For example, how to save new label of the node when using inline
            > editing of Treeview?
            >
            > In addition, when Treeview combine with Drag and Drop, how to save
            the new
            > order of the Treeview?
            >
            > For example 1, I think the key is detecting user press tick button.
            > For example 2, I am not sure, but maybe it is possible to construct
            > Treeview structure and translate it into XML or JSON format.
            >
            > Please give me a hand, thanks.
            >
            > Best Regards,
            >
            > Caxton
            >
          Your message has been successfully submitted and would be delivered to recipients shortly.