procedure skipped after placeAt() method

2019-09-05 20:47发布

问题:

I having a problem in placing the object to my div after the object creation, the object successfully create and place but wont allow me to setup my object or print out text after placing, this worked in my other project.

var prototypeUrl="resources/data/atmcdm_data.json";
            var dataPackage={};
            var rest = new Rest().postapi({"api" : ""}, prototypeUrl, dataPackage);

            var favorite = 0;
            var outOfService = 0;

            rest.then(function(response){
                var dataset = response.data;
                array.forEach(dataset, function(single, i){
                    if(dataset[i].favorite){
                        favorite = favorite + 1;

                        var dashBoardShortCutCell = new DashBoardShortCutCell().placeAt(context.shortCutContainerNode);
                        dashBoardShortCutCell.construct("favorite", favorite);
                    }

                    if(dataset[i].status == "OO"){
                        outOfService++;
                    }
                });



                console.log("here");

                var dashBoardShortCutCell = new DashBoardShortCutCell();
                dashBoardShortCutCell.construct("Out of Service", outOfService);
                dashBoardShortCutCell.placeAt(context.shortCutContainerNode);

            }, function(err){
                console.log("Error", err);
            }, function(evt){

            });