Opened 12 years ago

Closed 12 years ago

#2761 closed defect (wontfix)

FilteringTable if Date field has no value NaN is displayed

Reported by: guest Owned by: Tom Trenka
Priority: high Milestone:
Component: General Version: 0.4.2
Keywords: Cc:
Blocked By: Blocking:

Description

Problem:

When using FilterTable? and having a column for dataType="Date" but some of the rows of data (JSON data) do not have a value for the date (passing in an empty string), NaN is displayed in the table.

Solution:

I modified the code as follows to allow a "default error value" for dates in FilteringTable?

Markup/HTML (added 'errorDateValue' option):

<table dojoType="filteringTable" id="viewBorrowersDataTable"

multiple="false" alternateRows="true" cellpadding="0" cellspacing="0" border="0" valueField="debtNum" maxSelect="1" maxSortable="1" class="dataTable">

<thead> <tr>

<th field="debtNum" dataType="Number" sort="asc">Debt Number</th> <th field="closeDate" dataType="Date" format="%m/%d/%Y" errorDateValue=" ">Close Date</th>

</tr> </thead> <tbody> </tbody> </table>

Modifications to FilteringTable?.js are the following:

approx line (233) [added right after 'if (dojo.html.hasAttribute(cells[i], "filterusing"))' block]

if (dojo.html.hasAttribute(cells[i], "errorDateValue")) {

o.errorDateVal = dojo.html.getAttribute(cells[i], "errorDateValue");

}

approx line (489) [modified line]

from: cell.innerHTML = val; to: cell.innerHTML = (meta.errorDateVal != undefined) ? meta.errorDateVal : val;

Attachments (1)

FilteringTable.js (21.4 KB) - added by guest 12 years ago.

Download all attachments as: .zip

Change History (3)

Changed 12 years ago by guest

Attachment: FilteringTable.js added

comment:1 Changed 12 years ago by Adam Peller

Owner: changed from anonymous to Tom Trenka

comment:2 Changed 12 years ago by Tom Trenka

Resolution: wontfix
Status: newclosed

Can't even look at this code/patch without a known CLA on file. Closing this bug due to the fact that FilteringTable? will not be ported to Dijit.

Note: See TracTickets for help on using tickets.