cancel
Showing results for 
Search instead for 
Did you mean: 

SDK Component not rendered

hasba
Participant
0 Kudos

Dear Experts,

i'mm trying to create an SDK Component based on the treetable with dummy data but the component is not rendered at all.

i could debug and no error or exception is occuring, am i missing somthing in the component code?

thanks in advance!

define(["sap/designstudio/sdk/component"], 
	function(Component) {
	jQuery.sap.require("sap.zen.commons.layout.AbsoluteLayout"),
    jQuery.sap.require("sap.ui.table.TreeTable"),
    sap.zen.commons.layout.AbsoluteLayout.extend("com.sap.sample.treetable.TreeTable", {
		initDesignStudio: function() {
			this._oTable = new sap.ui.table.TreeTable(this.getId() + "trtb",{
				columns: [
			        new sap.ui.table.Column({
			          label: "Name",
			          template: "name"
			        }),
			        new sap.ui.table.Column({
			          label: "Description",
			          template: "description"
			        })
			      ],
			      selectionMode: sap.ui.table.SelectionMode.Single,
			      enableColumnReordering: true,
			      expandFirstLevel: true,
			      toggleOpenState: function(oEvent) {
			        var iRowIndex = oEvent.getParameter("rowIndex");
			        var oRowContext = oEvent.getParameter("rowContext");
			        var bExpanded = oEvent.getParameter("expanded");
			        alert("rowIndex: " + iRowIndex +
			          " - rowContext: " + oRowContext.getPath() +
			          " - expanded? " + bExpanded);
			      }
			    });
		},
		renderer: {},
		 afterDesignStudioUpdate: function() {
			 var data = getExampleData();
			 
			 


			 var oModel = new sap.ui.model.json.JSONModel();
				oModel.setData(data);
				this._oTable.setModel(oModel);
				this._oTable.bindRows("/root");
		 },


		getExampleData: function() {
			var oData = {
				      root: {
				        name: "root",
				        description: "root description",
				        checked: false,
				        0: {
				          name: "item1",
				          description: "item1 description",
				          checked: true,
				          0: {
				            name: "subitem1-1",
				            description: "subitem1-1 description",
				            checked: true,
				            0: {
				              name: "subsubitem1-1-1",
				              description: "subsubitem1-1-1 description",
				              checked: true
				            },
				            1: {
				              name: "subsubitem1-1-2",
				              description: "subsubitem1-1-2 description",
				              checked: true
				            }
				          },
				          1: {
				            name: "subitem1-2",
				            description: "subitem1-2 description",
				            checked: true,
				            0: {
				              name: "subsubitem1-2-1",
				              description: "subsubitem1-2-1 description",
				              checked: true
				            }
				          }


				        },
				        1: {
				          name: "item2",
				          description: "item2 description",
				          checked: true,
				          0: {
				            name: "subitem2-1",
				            description: "subitem2-1 description",
				            checked: true
				          }
				        },
				        2: {
				          name: "item3",
				          description: "item3 description",
				          checked: true
				        }


				      }
				    };
			
			return oData;
        },	
		
	    })
	    
});


Accepted Solutions (0)

Answers (0)