Hi,
We have a component MyGrid which has embedded Tapestry5 Grid component.
We needed to change the sorting images with our own and had first applied
the changes through css.
However, it was giving problems of space consistency.

In order to better it, we have initialized the below script through
renderSupport. The below solution works but it will fail if Sir Howard
Lewis, tomorrow changes the imagenames. Any inputs please?.

var MyGrid = Class.create();
MyGrid.prototype = {
initialize: function() {
this.sortImage();
},
sortImage : function(){
var objectArray = $$('img.t-sort-icon');
for(var i = 0; i < objectArray.size(); i++)
{
var imgSrc = objectArray[i].src;

if (imgSrc.indexOf("sort-asc.png")!=-1)
{
objectArray[i].src = "OurAscImage";
}
else if(imgSrc.indexOf("sort-desc.png")!=-1)
{
objectArray[i].src = "OurDownImage";
}
else if(imgSrc.indexOf("sortable.png")!=-1)
{
objectArray[i].src = "SpaceImage"; //To remove the empty effects
}
}
}
}


Thanks

Sandeep and Abhijit


-- 
View this message in context: 
http://old.nabble.com/Grid-Sorting-images-changed---One-of-the-approaches-provided-tp26621714p26621714.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to