Skip to content

Instantly share code, notes, and snippets.

@acatl
Created July 22, 2011 04:38
Show Gist options
  • Save acatl/1098903 to your computer and use it in GitHub Desktop.
Save acatl/1098903 to your computer and use it in GitHub Desktop.
itemrenderer example 5: using rendererFunction option
var itemrendererOptions = {
labelField: "name",
rendererFunction: function (container, listData) {
if(listData.data.price > 100) {
container.css("color","red");
}
container.html(listData.label);
},
dataProvider: [
{
name: "lorem",
price: 123.34
},
{
name: "lipsum",
price: 33.34
},
{
name: "dolor",
price: 23.34
},
{
name: "sit",
price: 623.34
}
]
};
$("#itemrenderer").itemrenderer(itemrendererOptions);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment