Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    ListGridField dataPath property - ASAP

    I am trying to use dataPath property to drive data on my listgrid and treegrid. Unfortunately, it works for listgrid but not for tree grid. I looked at the documentation and it said "all properties settable on ListGridField apply to TreeGridField as well. ". Could you please tell me whether this is a bug or if I am using this incorrectly?

    Code:
    isc.TreeGrid.create({
        ID: "employeeTree",
        width: 500,
        height: 400,
        dataSource: "employees",
        autoFetchData:true,
        nodeIcon:"icons/16/person.png",
        folderIcon:"icons/16/person.png",
        showOpenIcons:false,
        showDropIcons:false,
        closedIconSuffix:"",
        fields: [
            {name: "sob",dataPath:"Name"}
        ]
    });
    
    
    isc.ListGrid.create({
        ID: "countryList",
        width:500, height:224, alternateRecordStyles:true,
        data: countryData,
        fields:[
            {name:"sob", dataPath:"continent"}
        ],
    })

    #2
    Can you explain what you're trying to achieve here?

    If you want to have the "Foo" field's data show up in a field, typically you'd just set the field to have name:"Foo", and you could then edit other properties such as the title to get whatever custom appearance you're after.

    If you want a column to pull data from a different field in the data, you could use the displayField property instead.

    This looks like it might be an odd usage of dataPath -- if you can lay out exactly what you're trying to do we may be able to get you a more definitive answer.


    Thanks
    Isomorphic Software

    Comment


      #3
      ok - I forgot about displayField - we only use this for masked values. What exactly is dataPath for then? I wanted to keep the name the same but point to another resource.

      Comment


        #4
        dataPath is intended for navigating nested data structures.
        An example would be a case where a DataSource has a field with a type set to another DataSource (so for each record the field in question will be an object with the set of fields defined in the second DS). In this case you can specify a field on your component with a dataPath like "fieldA/innerFieldB" to extract and display that nested data (and handle deriving type information, etc)

        Comment


          #5
          displayField doesn't seem to be working for treegrid - the name does not get displayed when I point to the ds via displayField

          Code:
           <DataSource
              ID="employees"
              serverType="sql"
              tableName="employeeTable"
              recordName="employee"
              testFileName="/examples/shared/ds/test_data/employees.data.xml"
              titleField="Name"
          >
              <fields>
                  <field name="Name"            title="Name"            type="text"     length="128"/>
                  <field name="EmployeeId"      title="Employee ID"     type="integer"  primaryKey="true"  required="true"/>
                  <field name="ReportsTo"       title="Manager"         type="integer"  required="true" 
                         foreignKey="employees.EmployeeId"  rootValue="1" detail="true"/>
                  <field name="Job"             title="Title"           type="text"     length="128"/> 
                  <field name="Email"           title="Email"           type="text"     length="128"/>
                  <field name="EmployeeType"    title="Employee Type"   type="text"     length="40"/>
                  <field name="EmployeeStatus"  title="Status"          type="text"     length="40"/>
                  <field name="Salary"          title="Salary"          type="float"/>
                  <field name="OrgUnit"         title="Org Unit"        type="text"     length="128"/>
                  <field name="Gender"          title="Gender"          type="text"     length="7">
                      <valueMap>
                          <value>male</value>
                          <value>female</value>
                      </valueMap>
                  </field>
                  <field name="MaritalStatus"   title="Marital Status"  type="text"     length="10">
                      <valueMap>
                          <value>married</value>
                          <value>single</value>
                      </valueMap>
                  </field>
              </fields>
          </DataSource>
          isc.TreeGrid.create({
              ID: "employeeTree",
              width: 500,
              height: 400,
              dataSource: "employees",
              autoFetchData:true,
              nodeIcon:"icons/16/person.png",
              folderIcon:"icons/16/person.png",
              showOpenIcons:false,
              showDropIcons:false,
              closedIconSuffix:"",
              fields: [
                  {name: "myName",displayField:"Name"}
              ]
          });

          Comment


            #6
            We're looking at this - expect an update next week

            Regards
            Isomorphic Software

            Comment

            Working...
            X