Hi,
Could you suggest me on how to sort custom columns(Created using field creator) in listGrid.
I have create anchor tags using field creater, this needs to be sorted. The default sort on this doesnt work.
~Prakash
Hi Prakash,
I have created a example and it seems to me that the column with anchors can still be sorted by the content of the anchor(innerHTML).
Here is my example:
Cheers
Hi Prakash, I have created a
5 February, 2010 - 09:52 — yiniHi Prakash,
I have created a example and it seems to me that the column with anchors can still be sorted by the content of the anchor(innerHTML).
Here is my example:
<b:dataSource e:behavior="b:localData" dataType="application/xml">
<b:dataContainer>
<xi:include href="data/gridData.xml"></xi:include>
</b:dataContainer>
</b:dataSource>
<b:listGridCol select="title" label="Title " id="firstCol" datatype="string" width="200px">
<b:fieldCreator type="application/javascript">
//viewNode, controller, recordId, value var
var anchor = document.createElement('a');
anchor.href = 'http://'+value.replace(/\s+/g,'');
anchor.innerHTML= value;
viewNode.appendChild(anchor);
return viewNode;
</b:fieldCreator>
</b:listGridCol>
<b:listGridCol select="genre" label="Genre" datatype="string" width="100px"></b:listGridCol>
<b:listGridCol select="rating" label="Rating" datatype="number" width="70px" align="right"></b:listGridCol>
<b:listGridCol select="price" label="Price" datatype="number" width="70px" align="right"></b:listGridCol>
</b:listGrid>
If you are creating the anchors in other ways that make the sorting doesn't work, please let me know.
Cheers