Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

Tree.getFilteredTree correct usage

$
0
0
Hello Isomorphic, I'm facing some troubles using Tree getFilteredTree() method, it returns null even if there are records that should match the AdvancedCriteria.
More specifically, I modified the following SmartClient example, Trees -> DataBinding -> Parent linking using following snippet
Code:


var advancedCriteria = {
        _constructor:"AdvancedCriteria",
        criteria:[
            {fieldName:"Code", operator:"iStartsWith", value:"1.1"}
        ]
    }


isc.TreeGrid.create({
    ID: "employeeTree",
    data: isc.Tree.create({
        modelType: "parent",
        nameProperty: "Name",
        idField: "EmployeeId",
        parentIdField: "ReportsTo",
        data: [
            {EmployeeId:"4", ReportsTo:"1", Name:"Charles Madigen", Code:"1"},
            {EmployeeId:"188", ReportsTo:"4", Name:"Rogine Leger", Code:"1.1"},
            {EmployeeId:"189", ReportsTo:"4", Name:"Gene Porter", Code:"1.2"},
            {EmployeeId:"265", ReportsTo:"189", Name:"Olivier Doucet", Code:"1.1.1"},
            {EmployeeId:"264", ReportsTo:"189", Name:"Cheryl Pearson", Code:"1.3"}
        ]
    }).getFilteredTree(advancedCriteria),

    // customize appearance
    width: 500,
    height: 400,
    nodeIcon:"icons/16/person.png",
    folderIcon:"icons/16/person.png",
    showOpenIcons:false,
    showDropIcons:false,
    closedIconSuffix:""
});

Gui claims that there is not any node to show.
I tried to use "startsWith" operator, obtaining the same result, and I put a simple criteria too, {Code:'1.1'}, but no nodes were returned.
I can't understand what is missing or where my fault lies.
I made a test with smartgwt too, 5.1d 2014-10-08 build, obtaining the same result, but if I invoke the findAll method, using the same AdvancedCriteria, I get the expected records.
I attached the simple main class I used for the test

Thanks in advance

Attached Files
File Type: java Main.java (2.5 KB)

Viewing all articles
Browse latest Browse all 4756

Trending Articles