[CLOSED] [#233] Cannot bind DataIndex starting with case letter in TreePanel

Page 1 of 2 12 LastLast
  1. #1

    [CLOSED] [#233] Cannot bind DataIndex starting with case letter in TreePanel

    I've a TreePanel (a GridPanel), where i pass data as a NodeCollection, via proxy, where fields data are declared in attributeObject (is it ocrrect?).

    Main.Models.LegDTO a = new LegDTO();
                        a.legID = 2;
                        a.LegCodice = "aaaaaa";
    
                        asyncNode.AttributesObject = a;
    Binding:
    Html.X().Column()
                                            .Text("LegCodice")
                                            .DataIndex("LegCodice")

    If the attribute starts with case letter, binding doesn't work, if it doesn't start with case letter, it does work.

    If I write 'legCodice' everywhere (in the DTO Entity, in the dataIndex, and in the AttributeObject), it works. If I use LegCodice, it does not work.
    Is this a bug or I'm losing something?
    Last edited by Baidaly; May 13, 2013 at 3:42 AM. Reason: [CLOSED] [#233]
  2. #2
    Hello!

    Try to use CustomAttributes instead of AttributesObject
  3. #3
    Thank you.

    How can I convert a generic T Entity in a a ConfigItemCollection?

    Now I'm using

    node.AttributesObject = record
    where record is of type T.

    It compiles because AttributesObject expects an object.

    But CustomAttributes requires a ConfigItemCollection.
    How can i So convert T in a ConfigItemCollection?

    TY
  4. #4
    Please try:
    Main.Models.LegDTO a = new LegDTO();
    a.legID = 2;
    a.LegCodice = "aaaaaa";
    
    asyncNode.CustomAttributes.Add(a);
  5. #5
    Generally, converting the first letter to be lowercase is a common thing across the library. It is because of JavaScript convention to start property names from a lowercase letter.

    But it should be configurable. I created an Issue.
    https://github.com/extnet/Ext.NET/issues/233
  6. #6
    Using custom attributes, it works quite well. Anyway, I'm watching for a good architecture, so I would like to understand if using customAttributes is a good way or just a workaround.
    Should it be better to use attributesObejct?
    I'm using codefirst to define entities and to map fields on db. Which convention should be used to define Entitie's properties names?
    Should they be lower case?

    Thank you again!
  7. #7
    Using CustomAttributes is not a workaround, it can be a permanent solution.

    Should it be better to use attributesObejct?
    Well, no. They actually do the same. Just an AttributesObject is serialized with lowercase first letters.

    Which convention should be used to define Entitie's properties names?
    Should they be lower case?
    Personally, I would follow .NET property naming convention, i.e. uppercase first letters. Well, as you already did.
  8. #8
    I will do so. Thank you!
  9. #9
    Hello!

    We added new property AttributesCamelCase to Node class which you can use to solve your issue.

    Please, update from SVN and retest.
  10. #10
    Thank you.
    I have no access to svn repo. There is a way to test it?

    M
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 1
    Last Post: Mar 24, 2013, 9:40 AM
  2. [CLOSED] Need ability to search combobox items by lower case or upper case
    By wisdomchuck in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jul 23, 2012, 1:40 PM
  3. [CLOSED] DataIndex on DropDownField with a TreePanel
    By SouthDeveloper in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Nov 18, 2011, 8:42 AM
  4. Replies: 2
    Last Post: Sep 22, 2011, 10:17 PM
  5. Bind xml to treepanel
    By Mr.Techno in forum 1.x Help
    Replies: 0
    Last Post: Sep 21, 2011, 5:46 AM

Tags for this Thread

Posting Permissions