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

Hybrid View

Previous Post Previous Post   Next Post Next Post
  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 4: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!

Similar Threads

  1. Replies: 1
    Last Post: Mar 24, 2013, 10: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, 2: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, 9:42 AM
  4. Replies: 2
    Last Post: Sep 22, 2011, 11:17 PM
  5. Bind xml to treepanel
    By Mr.Techno in forum 1.x Help
    Replies: 0
    Last Post: Sep 21, 2011, 6:46 AM

Tags for this Thread

Posting Permissions