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

valueXPath help

$
0
0
I seem to be missing something small here, but I cannot figure out why the valueXPath is not working:

Code:

<!DOCTYPE html>

<html>
        <head>

                <title></title>
               
                <style>
                        .diagInfo {
                                font-size: 14px;
                                font-weight: bold;
                                padding: 5px;
                        }
                </style>
               
                <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_Core.js"></script>
                <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_Foundation.js"></script>
                <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_Containers.js"></script>
                <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_Grids.js"></script>
                <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_Forms.js"></script>
                <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_DataBinding.js"></script>
                <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_Drawing.js"></script>
                <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_PluginBridges.js"></script>
                <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_Charts.js"></script>       
                <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_Tools.js"></script>
                <script type="text/javascript" SRC="http://localhost:8080/isomorphic/skins/EnterpriseBlue/load_skin.js"></script>
       
                <script type="text/javascript" >
                        var isomorphicDir="http://localhost:8080/isomorphic/";
                       
                        // set this to the correct JIRA ticket
                        var jiraTicket = "SNQA-431";
                       
                        // test data
                        var data = [
                                { inspections: 32, project: { title: "ABC Project"} },
                                { inspections: 14, project: { title: "Joe's Crab Shack"} },
                                { inspections: 0, project: { title: "Pizza Hut"} },
                                { inspections: 2, project: { title: "Home Depot"} }
                        ];
                       
                        // datasource for the grid               
                        isc.DataSource.create({
                                ID: "ds",
                                fields: [
                                        {name:"title", title:"Project Title", valueXPath: "project/title"},
                                        {name:"inspections", type:"integer", title:"Inspection Counts"}

                                ],
                                cacheData:data,
                                clientOnly: true
                        });
                       
                        // once page loads set some diagnostic information
                        isc.Page.setEvent("load", function() {
                                document.title = jiraTicket + "  (SmartClient version " + isc.versionNumber + ")";
                                var html = [];
                                html.push("Jira: " + jiraTicket);
                                html.push("SmartClient: " + isc.versionNumber);
                                html.push("Browser: " + navigator.appCodeName + " " + navigator.appName + " " + navigator.appVersion);
                                diagLabel.setContents( html.join("<br>"));
                        });
                       
               
                </script>

        </head>
       
        <body>
                <script>
               
                        // this laebl should not be removed, all test cases should have this
                        var diagLabel = isc.Label.create({
                                                ID: "diagInfo",
                                                width: "100%",
                                                styleName: "diagInfo",
                                                autoFit: true
                                        });
                       
                        // basic grid               
                        var grid = isc.ListGrid.create({
                                dataSource: ds,
                                dataFetchMode : "local",
                                autoFetchData: true,
                                clientOnly: true,
                                position: "relative",
                                width : "100%",
                                align : "center",
                                autoFitData : "vertical",
                                autoFitMaxHeight : 400,
                                alternateRecordStyles : true,
                                canAddFormulaFields : true,
                                canAddSummaryFields : true,
                                canGroupBy : true,
                                canReorderFields : true,
                                showGroupSummary : true,
                                groupByMaxRecords : 15,
                                useAdvancedFieldPicker: true,
                                advancedFieldPickerThreshold: 5,
                                autoDraw: false
                        });       
                                               
                        // the main page layout - place all other components afetr diagLabel
                        isc.VLayout.create({
                                width:"100%",
                                membersMargin: 20,
                                members: [
                                        // this must remain here to output diagnostic information
                                        diagLabel,
                                        // add any other components here
                                        grid
                                ]
                        });

                               
                </script>

        </body>

</html>


Viewing all articles
Browse latest Browse all 4756

Trending Articles