Skip to Content
0
Dec 19, 2013 at 10:32 AM

Binding a single data row

32 Views

Hi All:

I have below code:

$.ajax({ url:ajaxURL,

dataType : "json",

async : false,

success : function(data){

qModel = new sap.ui.model.json(data);

oListQuestions.setModel(qModel);

oListQuestions.bindItem("/d/results", oTemplateQuestions);

}

})

which works perfectly and I get all the questions displayed in a list. However, I like to bind one row at a time. Is there a way to do this:

oListQuestions.bindItem("/d/results/0", oTemplateQuestions); ?

Note: "/d/results/0" is the first object in the list. Somehow, bindItems() expects an array of objects.

Thanks so much for your help. It is much appreciated.

Cheers,

Ron