How can I disable href link in cfgrid cells for blank rows?
I have the following cfgrid:
<cfgrid format="html" name="grid" pagesize="10" selectmode="row" striperows="yes"
bind="cfc:data.getData({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection})">
<cfgridcolumn name="link" header="Link" href="link.cfm" hrefkey="link_id">
</cfgrid>
Since pagesize is 10, I'll have some blank rows if I have less than 10 rows in the grid. For those blank row I'd have a '-' sign in place of the usual data, and the hrefkey will be null instead of the usual link_id. Is there a way to disa开发者_Go百科ble the href for blank rows? Or if there's a way to capture the null value with javascript?
You can loop through the a hrefs within the table and find all the hrefs that contain the '-' and change this to something else or remove the href completely. This can be done in JS but ideally I would try and do this before hand (i.e in CF) as there will be an overhead using JS to do this.
精彩评论