Results 1 to 2 of 2

Thread: Represent Files/Folders with TreeStore

  1. #1
    Sencha User
    Join Date
    Dec 2012
    Posts
    19
    Vote Rating
    0
      0  

    Default Represent Files/Folders with TreeStore

    Hi all, I'm using a TreeStore to represent a file/folders structure from a server. I guess the TreeStore uses the NodeInterface object to show each element.

    I know there's a leaf property to represent parents (which can be folders) and final elements (let's say files within a directory).

    My problem is:
    If I create a folder a need to view it as a folder in the TreeStore so I need to set the leaf property as false but if the folder is empty then everything crashes. I don't know if having leaf = false forces to read children elements. I've tried by leaving the children property as null or empty array but no positive results.

    If the folder is new then it's 'almost' sure it will be empty so I need it not to be leaf and painted as parent without trying to look for children elements.

    Is it possible to change (and where/how) which property should my app use to determine

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,327
    Vote Rating
    1297
      0  

    Default

    So if you have children : [] it will still look for children when you expand?
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •